Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-------------------------------------------------
- //
- // Seifanimations - Perfect for role playing servers
- // Based on kyeman's vactions script
- //
- //-------------------------------------------------
- #include <a_samp>
- #include <core>
- #include <float>
- #define GREEN 0x21DD00FF
- #define RED 0xE60000FF
- #define ADMIN_RED 0xFB0000FF
- #define YELLOW 0xFFFF00FF
- #define ORANGE 0xF97804FF
- #define LIGHTRED 0xFF8080FF
- #define LIGHTBLUE 0x00C2ECFF
- #define PURPLE 0xB360FDFF
- #define PLAYER_COLOR 0xFFFFFFFF
- #define BLUE 0x1229FAFF
- #define LIGHTGREEN 0x38FF06FF
- #define DARKPINK 0xE100E1FF
- #define DARKGREEN 0x008040FF
- #define ANNOUNCEMENT 0x6AF7E1FF
- #define COLOR_SYSTEM 0xEFEFF7AA
- #define GREY 0xCECECEFF
- #define PINK 0xD52DFFFF
- #define DARKGREY 0x626262FF
- #define AQUAGREEN 0x03D687FF
- #define NICESKY 0x99FFFFAA
- #define WHITE 0xFFFFFFFF
- #define SPECIAL_ACTION_PISSING 68
- new gPlayerUsingLoopingAnim[MAX_PLAYERS];
- new gPlayerAnimLibsPreloaded[MAX_PLAYERS];
- new animation[200];
- //-------------------------------------------------
- // ********** INTERNAL FUNCTIONS **********
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- OnePlayAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
- {
- if (gPlayerUsingLoopingAnim[playerid] == 1)
- ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
- animation[playerid]++;
- }
- //-------------------------------------------------
- LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
- {
- if (gPlayerUsingLoopingAnim[playerid] == 1)
- gPlayerUsingLoopingAnim[playerid] = 1;
- ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
- animation[playerid]++;
- }
- //-------------------------------------------------
- //-------------------------------------------------
- PreloadAnimLib(playerid, animlib[])
- {
- ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
- }
- //-------------------------------------------------
- // ********** CALLBACKS **********
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(!gPlayerUsingLoopingAnim[playerid]) return;
- //SendClientInt(playerid, RED, "ID: %d", newkeys);
- if((newkeys & KEY_SPRINT)) {
- animation[playerid] = 0;
- }
- }
- //------------------------------------------------
- public OnPlayerDeath(playerid, killerid, reason)
- {
- // if they die whilst performing a looping anim, we should reset the state
- if(gPlayerUsingLoopingAnim[playerid]) {
- gPlayerUsingLoopingAnim[playerid] = 0;
- }
- return 1;
- }
- //-------------------------------------------------
- public OnPlayerSpawn(playerid)
- {
- if(!gPlayerAnimLibsPreloaded[playerid]) {
- PreloadAnimLib(playerid,"BOMBER");
- PreloadAnimLib(playerid,"RAPPING");
- PreloadAnimLib(playerid,"SHOP");
- PreloadAnimLib(playerid,"BEACH");
- PreloadAnimLib(playerid,"SMOKING");
- PreloadAnimLib(playerid,"FOOD");
- PreloadAnimLib(playerid,"ON_LOOKERS");
- PreloadAnimLib(playerid,"DEALER");
- PreloadAnimLib(playerid,"CRACK");
- PreloadAnimLib(playerid,"CARRY");
- PreloadAnimLib(playerid,"COP_AMBIENT");
- PreloadAnimLib(playerid,"PARK");
- PreloadAnimLib(playerid,"INT_HOUSE");
- PreloadAnimLib(playerid,"FOOD");
- PreloadAnimLib(playerid,"PED");
- gPlayerAnimLibsPreloaded[playerid] = 1;
- }
- return 1;
- }
- //-------------------------------------------------
- public OnPlayerConnect(playerid)
- {
- gPlayerUsingLoopingAnim[playerid] = 0;
- gPlayerAnimLibsPreloaded[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- new tmp[256];
- new idx;
- new dancestyle;
- cmd = strtok(cmdtext, idx);
- if(strcmp(cmd,"/animlist",true)==0)
- {
- SendClientMessage(playerid, YELLOW, "___________________________________");
- SendClientMessage(playerid,RED,"Party Animations");
- SendClientMessage(playerid,WHITE,"/laugh - /crossarms - /lay - /wave");
- SendClientMessage(playerid,WHITE,"/slapass - /groundsit - /chat - /chairsit");
- SendClientMessage(playerid,WHITE,"/fall - /fallback - /kiss - /rap[1-4]");
- SendClientMessage(playerid,WHITE,"/tapcig - /lay2 - /lean - /strip[A-G]");
- SendClientMessage(playerid,WHITE,"/bedright - /bedleft - /dance[1-7]]");
- SendClientMessage(playerid, YELLOW, "�����������������������������������");
- return true;
- }
- // Laugh
- if (strcmp("/laugh", cmdtext, true) == 0) {
- OnePlayAnim(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh
- return 1;
- }
- // Arms crossed
- if (strcmp("/crossarms", cmdtext, true) == 0) {
- LoopingAnim(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1); // Arms crossed
- return 1;
- }
- // Lay Down
- if (strcmp("/lay", cmdtext, true) == 0) {
- LoopingAnim(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0); // Lay down
- return 1;
- }
- // Wave
- if (strcmp("/wave", cmdtext, true) == 0) {
- LoopingAnim(playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0); // Wave
- return 1;
- }
- // Slap Ass
- if (strcmp("/slapass", cmdtext, true) == 0) {
- OnePlayAnim(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0); // Ass Slapping
- return 1;
- }
- // Sit
- if (strcmp("/groundsit", cmdtext, true) == 0 || strcmp("/gro", cmdtext, true) == 0) {
- LoopingAnim(playerid,"BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0); // Sit
- return 1;
- }
- // Idle Chat
- if(strcmp(cmd, "/chat", true) == 0) {
- LoopingAnim(playerid,"PED","IDLE_CHAT",4.0,1,0,0,1,1);
- return 1;
- }
- // ChairSit
- if(strcmp(cmd, "/chairsit", true) == 0) {
- LoopingAnim(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
- return 1;
- }
- // Fall on the ground
- if(strcmp(cmd, "/fall", true) == 0) {
- LoopingAnim(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
- return 1;
- }
- // Fall
- if(strcmp(cmd, "/fallback", true) == 0) {
- LoopingAnim(playerid, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
- return 1;
- }
- // kiss
- if(strcmp(cmd, "/kiss", true) == 0) {
- LoopingAnim(playerid, "KISSING", "Playa_Kiss_02", 3.0, 1, 1, 1, 1, 0);
- return 1;
- }
- // Rap animations
- if(strcmp(cmd, "/rap", true) == 0)
- {
- if (!strlen(cmdtext[5])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /rap [1-4]");
- switch (cmdtext[5])
- {
- case '1': LoopingAnim(playerid,"RAPPING","RAP_A_Loop",4.0,1,0,0,0,0);
- case '2': LoopingAnim(playerid,"RAPPING","RAP_C_Loop",4.0,1,0,0,0,0);
- case '3': LoopingAnim(playerid,"GANGS","prtial_gngtlkD",4.0,1,0,0,0,0);
- case '4': LoopingAnim(playerid,"GANGS","prtial_gngtlkH",4.0,1,0,0,1,1);
- default: SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /rap [1-4]");
- }
- return 1;
- }
- // Tap cigarette
- if(strcmp(cmd, "/tapcig", true) == 0) {
- OnePlayAnim(playerid,"SMOKING","M_smk_tap",3.0,0,0,0,0,0);
- return 1;
- }
- // Lay 2
- if(strcmp(cmd, "/lay2", true) == 0) {
- LoopingAnim(playerid,"SUNBATHE","Lay_Bac_in",3.0,0,1,1,1,0);
- return 1;
- }
- // Leaning animation
- if(strcmp(cmd, "/lean", true) == 0)
- {
- if (!strlen(cmdtext[6])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /lean [1-2]");
- switch (cmdtext[6])
- {
- case '1': LoopingAnim(playerid,"GANGS","leanIDLE",4.0,0,1,1,1,0);
- case '2': LoopingAnim(playerid,"MISC","Plyrlean_loop",4.0,0,1,1,1,0);
- default: SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /lean [1-2]");
- }
- return 1;
- }
- // Strip
- if(strcmp(cmd, "/strip", true) == 0)
- {
- if (!strlen(cmdtext[7])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /strip [A-G]");
- switch (cmdtext[7])
- {
- case 'a', 'A': LoopingAnim(playerid,"STRIP", "strip_A", 4.1, 1, 1, 1, 1, 1 );
- case 'b', 'B': LoopingAnim(playerid,"STRIP", "strip_B", 4.1, 1, 1, 1, 1, 1 );
- case 'c', 'C': LoopingAnim(playerid,"STRIP", "strip_C", 4.1, 1, 1, 1, 1, 1 );
- case 'd', 'D': LoopingAnim(playerid,"STRIP", "strip_D", 4.1, 1, 1, 1, 1, 1 );
- case 'e', 'E': LoopingAnim(playerid,"STRIP", "strip_E", 4.1, 1, 1, 1, 1, 1 );
- case 'f', 'F': LoopingAnim(playerid,"STRIP", "strip_F", 4.1, 1, 1, 1, 1, 1 );
- case 'g', 'G': LoopingAnim(playerid,"STRIP", "strip_G", 4.1, 1, 1, 1, 1, 1 );
- default: SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /strip [A-G]");
- }
- return 1;
- }
- // Bed Sleep R
- if(strcmp(cmd, "/bedright", true) == 0) {
- LoopingAnim(playerid,"INT_HOUSE","BED_Loop_R",4.0,1,0,0,0,0);
- return 1;
- }
- // Bed Sleep L
- if(strcmp(cmd, "/bedleft", true) == 0) {
- LoopingAnim(playerid,"INT_HOUSE","BED_Loop_L",4.0,1,0,0,0,0);
- return 1;
- }
- // START DANCING
- if(strcmp(cmd, "/dance", true) == 0) {
- // Get the dance style param
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid,0xFF0000FF,"USAGE: /dance [style 1-4]");
- return 1;
- }
- dancestyle = strval(tmp);
- if(dancestyle < 1 || dancestyle > 4) {
- SendClientMessage(playerid,0xFF0000FF,"USAGE: /dance [style 1-4]");
- return 1;
- }
- if(dancestyle == 1) {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
- } else if(dancestyle == 2) {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
- } else if(dancestyle == 3) {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
- } else if(dancestyle == 4) {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4);
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment