SA-MP Forums Archive
Bug jetpack - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bug jetpack (/showthread.php?tid=566500)



Bug jetpack - madalin912 - 06.03.2015

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



Re: Bug jetpack - madalin912 - 06.03.2015

still does not work .


Re: Bug jetpack - MBilal - 06.03.2015

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



Re: Bug jetpack - madalin912 - 06.03.2015

else please?


Re: Bug jetpack - Matess - 06.03.2015

remove IsPlayerAdmin somewhere


Re: Bug jetpack - Luis- - 06.03.2015

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.


Re: Bug jetpack - Threshold - 06.03.2015

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


Re: Bug jetpack - madalin912 - 06.03.2015

if it does not work out IsPlayerAdmin ?


Re: Bug jetpack - Luis- - 06.03.2015

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.


Re: Bug jetpack - Golf - 06.03.2015

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