Bug jetpack
#1

How do you go /jetpack no rcon, not working /jetpack if not connected to rcon.

pawn Код:
if(strcmp(cmd, "/jetpack", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
                SendClientMessage(playerid, 0xFF7F50AA, "You have jetpack now!");
                SetPlayerSpecialAction(playerid,2);
                return 1;
            }
            else
            {
                SendClientMessage(playerid,COLOR_GREY,"You can't use this command.");
                return 1;
            }
        }
     }
Reply
#2

still does not work .
Reply
#3

if u want it to use this cmd for simple player then use this
Код:
if(strcmp(cmd, "/jetpack", true) == 0)
	{
        if(IsPlayerConnected(playerid))
	    {
             	SendClientMessage(playerid, 0xFF7F50AA, "You have jetpack now!");
             	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
return 1;
        }
return 1;
     }
if u want to use for admin. remember u must set your level to 1337 to use this CMD !

Код:
if(strcmp(cmd, "/jetpack", true) == 0)
	{
        if(IsPlayerConnected(playerid))
	    {
		if (PlayerInfo[playerid][pAdmin] >= 1337)
	 {
             	SendClientMessage(playerid, 0xFF7F50AA, "You have jetpack now!");
             	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
             	return 1;
            }
            else
            {
             	SendClientMessage(playerid,COLOR_GREY,"You can't use this command.");
             	return 1;
            }
        }
return 1;
     }
Reply
#4

else please?
Reply
#5

remove IsPlayerAdmin somewhere
Reply
#6

Guessing you want it to work with RCON admins too?
pawn Код:
if(strcmp(cmd, "/jetpack", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1337 || IsPlayerAdmin(playerid))
            {
                SendClientMessage(playerid, 0xFF7F50AA, "You have jetpack now!");
                SetPlayerSpecialAction(playerid,2);
                return 1;
            }
            else
            {
                SendClientMessage(playerid,COLOR_GREY,"You can't use this command.");
                return 1;
            }
        }
     }
Also, why are you returning 1 after every function? There's no need to do that. You only need one return 1 and that's before the last bracket.
Reply
#7

pawn Код:
if(strcmp(cmd, "/jetpack", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 1337 || IsPlayerAdmin(playerid))
            {
                SendClientMessage(playerid, 0xFF7F50AA, "You have jetpack now!");
                SetPlayerSpecialAction(playerid,2);
            }
            else SendClientMessage(playerid,COLOR_GREY,"You can't use this command.");
            return 1;
        }
        return 0;
    }
References:
https://sampwiki.blast.hk/wiki/IsPlayerAdmin
https://sampwiki.blast.hk/wiki/Control_Structures#Operators
Reply
#8

if it does not work out IsPlayerAdmin ?
Reply
#9

Quote:
Originally Posted by madalin912
Посмотреть сообщение
if it does not work out IsPlayerAdmin ?
I'm having a hard time understanding what you're saying, you maybe better posting in your native languages board.
Reply
#10

u want it to work only with RCON ?? https://sampwiki.blast.hk/wiki/IsPlayerAdmin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)