Anims Help
#1

Hi everyone,
I was wondering if you could help me get this Animation Code working for me?
I want the Animations to be infinite until the User Cancels it [Enter or Tabbing] and I want some Commands like /aim to allow you to move around. Here is the Code:
Код:
#include <a_samp>
#include <core>
#include <float>

#define COLOR_WHITE 0xFFFFFFAA

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;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[256];
	new idx;
	new dancestyle;
	cmd = strtok(cmdtext, idx);
	
	if(strcmp(cmdtext, "/ahelp", true) == 0) {
	SendClientMessage(playerid,COLOR_WHITE,"/plant /arrest /laugh /lookout /rob /wank");
	SendClientMessage(playerid,COLOR_WHITE,"/arrest /arrested /bleeding /fsmoke /coplook");
	SendClientMessage(playerid,COLOR_WHITE,"/lay /hide /vomit /eat /wave /slapass /death");
	SendClientMessage(playerid,COLOR_WHITE,"/deal /kiss /crack /piss /msmoke /sit /fuckyou");
 	SendClientMessage(playerid,COLOR_WHITE,"/strip /dance /handsup");
 	return 1;
 	}
 	if(strcmp(cmd, "/handsup", true) == 0) {
		if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
		  SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
          return 1;
     }
	}
    if(strcmp(cmd, "/drunk", true) == 0) {
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
     {
          ApplyAnimation(playerid,"PED", "WALK_DRUNK",4.0,0,1,0,0,0);
          return 1;
     }
    }
    if (strcmp("/plant", cmdtext, true) == 0) {
	      ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/arrest", cmdtext, true) == 0) {
	      ApplyAnimation( playerid,"ped", "ARRESTgun", 4.0, 0, 0, 0, 0, 0);
		  return 1;
    }
    if (strcmp("/laugh", cmdtext, true) == 0) {
          ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/lookout", cmdtext, true) == 0) {
          ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/rob", cmdtext, true) == 0) {
          ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/wank", cmdtext, true) == 0) {
          ApplyAnimation(playerid, "PAULNMAC", "wank_loop", 4.0, 0, 0, 0, 0, 0);
		  return 1;
 	}
    if (strcmp("/arrested", cmdtext, true) == 0) {
          ApplyAnimation(playerid, "POLICE", "crm_drgbst_01", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/bleeding", cmdtext, true) == 0) {
          ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/fsmoke", cmdtext, true) == 0) {
          ApplyAnimation(playerid, "SMOKING", "F_smklean_loop", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/coplook", cmdtext, true) == 0) {
          ApplyAnimation(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/lay", cmdtext, true, 6) == 0) {
          ApplyAnimation(playerid,"BEACH", "bather", 4.0, 0, 0, 0, 0, 0);
		  return 1;
    }
    if (strcmp("/hide", cmdtext, true, 3) == 0) {
          ApplyAnimation(playerid, "ped", "cower", 3.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/vomit", cmdtext, true) == 0) {
	      ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/eat", cmdtext, true) == 0) {
	      ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.00, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/wave", cmdtext, true) == 0) {
	      ApplyAnimation(playerid, "KISSING", "BD_GF_Wave", 3.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/slapass", cmdtext, true) == 0) {
          ApplyAnimation(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/death", cmdtext, true) == 0) {
          ApplyAnimation(playerid, "WUZI", "CS_Dead_Guy", 4.0, 0, 0, 0, 0, 0);
		  return 1;
    }
    if (strcmp("/deal", cmdtext, true) == 0) {
          ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/kiss", cmdtext, true, 5) == 0) {
          ApplyAnimation(playerid, "KISSING", "Playa_Kiss_02", 3.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/crack", cmdtext, true, 6) == 0) {
          ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/piss", cmdtext, true, 8) == 0) {
          ApplyAnimation(playerid, "PAULNMAC", "Piss_in", 3.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/msmoke", cmdtext, true, 4) == 0) {
          ApplyAnimation(playerid,"SMOKING", "M_smklean_loop", 4.0, 0, 0, 0, 0, 0);
		  return 1;
	}
    if (strcmp("/sit", cmdtext, true, 4) == 0) {
          ApplyAnimation(playerid,"BEACH", "ParkSit_M_loop", 4.0, 0, 0, 0, 0, 0);
		  return 1;
    }
    if (strcmp("/fuckyou", cmdtext, true, 2) == 0) {
	      ApplyAnimation( playerid,"ped", "fucku", 4.1, 0, 1, 1, 1, 1 );
		  return 1;
    }
    if (strcmp("/strip", cmdtext, true, 6) == 0)
    {
    switch (cmdtext[7])
    {
        case 'a', 'A':{ ApplyAnimation( playerid,"STRIP", "strip_A", 4.1, 0, 1, 1, 1, 1 ); return 1; }
        case 'b', 'B':{ ApplyAnimation( playerid,"STRIP", "strip_B", 4.1, 0, 1, 1, 1, 1 ); return 1; }
        case 'c', 'C':{ ApplyAnimation( playerid,"STRIP", "strip_C", 4.1, 0, 1, 1, 1, 1 ); return 1; }
        case 'd', 'D':{ ApplyAnimation( playerid,"STRIP", "strip_D", 4.1, 0, 1, 1, 1, 1 ); return 1; }
        case 'e', 'E':{ ApplyAnimation( playerid,"STRIP", "strip_E", 4.1, 0, 1, 1, 1, 1 ); return 1; }
        case 'f', 'F':{ ApplyAnimation( playerid,"STRIP", "strip_F", 4.1, 0, 1, 1, 1, 1 ); return 1; }
        case 'g', 'G':{ ApplyAnimation( playerid,"STRIP", "strip_G", 4.1, 0, 1, 1, 1, 1 ); return 1; }
    }
    return 1;
    }
    if(strcmp(cmd, "/talk", true) == 0)
{
     if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
     {
         ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,0,1,1,1,1);
         return 1;
     }
}
 	if(strcmp(cmd, "/dance", true) == 0) {
		if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
		    new tmp[256];
      		tmp = strtok(cmdtext, idx);
			if(!strlen(tmp)) {
				SendClientMessage(playerid,COLOR_WHITE,"Usage: /dance [style 1-3]");
				return 1;
			}
			
			dancestyle = strval(tmp);
			if(dancestyle < 1 || dancestyle > 3) {
			    SendClientMessage(playerid,COLOR_WHITE,"Usage: /dance [style 1-3]");
			    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);
			}
 	  		return 1;
	 }
	}
	return 0;
    }
I thank you all for your Help
Reply
#2

This is more like a Script request.. and what you need help with is giving you errors ?
Reply
#3

pawn Код:
ApplyAnimation(playerid,"SHOP","SHP_GUN_AIM",2,0,1,1,1,1,1);
Reply
#4

Thanks alot varthshenon, it worked great
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)