Anim problem with JETPACK
#1

I use this command to get jetpack for admin players, but my arms are stuck
http://i.imgur.com/1m0uFzC.jpg

This is the code
PHP код:
CMD:jetpack(playeridparams[])
{
if(
IsPlayerAdmin(playerid))
{
SetPlayerSpecialAction(playeridSPECIAL_ACTION_USEJETPACK);
}
else if(
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
{
ClearAnimations(playerid);
return 
1;
}
return 
1;

Reply
#2

Try This command
Код:
CMD:jetpack(playerid, params[])
{
        if(IsPlayerAdmin(playerid)) 
	{
	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) return SendClientMessage(playerid, COLOR_RED, "[JETPACK] "white"You are already using a jetpack.");
 	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
  	SendClientMessage(playerid, COLOR_RED, "You have spawned  jetpack.");
	}
	else
	{
	    SendClientMessage(playerid, -1, "You Are Not Authorized To Use This Command.");
	}
	return 1;
}
Reply
#3

It's not what I want.
I want to spawn jetpack by /jetpack (only if player is admin) and remove the jetpack with the same command
Reply
#4

Код:
CMD:jetpack(playerid, params[])
{
        if(IsPlayerAdmin(playerid))
	{
	new jetpack = GetPVarInt(playerid, "JetPack");
	if(jetpack == 0)
	{
 	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
  	SendClientMessage(playerid, COLOR_RED, "You have spawned  jetpack.");
	}
	else
	{
	ClearAnimations(playerid);
  	SendClientMessage(playerid, COLOR_RED, "Your JetPack Is now Gone.");

	    SetPVarInt(playerid, "GodMode", 0);
	}
	}
	else
	{
	    SendClientMessage(playerid, -1, "You Are Not Authorized To Use This Command..");
	}
	return 1;
}
Reply
#5

No, it's not fine because id 0 will change, you're not helping me
Reply
#6

i Edited my post. now see
Reply
#7

PHP код:
CMD:jetpack(playerid){
    if(!
IsPlayerAdmin(playerid)) return 0;
    if(
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK){
        
ClearAnimations(playerid);
    } else {
        
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK); 
    }
    return 
1

Reply
#8

Firstly, intend your code because this one is clearly bad to see.
This one is perfectly working for me.
PHP код:
CMD:jetpack(playerid)
{
    if(!
IsPlayerAdmin(playerid)) return 1;
    if(
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACKClearAnimations(playerid);
    else 
SetPlayerSpecialAction(playeridSPECIAL_ACTION_USEJETPACK), SendClientMessage(playerid, -1"You have spawned  jetpack.");
    return 
1;

Reply
#9

I get the same problem with the codes you posted
Reply
#10

This command works on my previous gamemode, but it's not working on new gamemode

PHP код:
CMD:jetpack(playeridparams[]) {
if(
AdminDuty[playerid] != 1)
            {
                
SendClientMessage(playerid0x04C4D9AA"|- Devi essere Aduty per porter utilizzare i comandi admin -|");
                return 
1;
            }
            else if(
AdminDuty[playerid] != 0) {
            
SetPlayerSpecialAction(playeridSPECIAL_ACTION_USEJETPACK);
            }
            if(
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) {
            
ClearAnimations(playerid);
            }
            return 
1;
            } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)