Jetpack Command
#8

I made this so you can give it to a player..

pawn Код:
if(strcmp(cmdtext,"/jetpack",true) == 0)
{
    if(PlayerInfo[playerid][pAdmin] == 1338)
    {
        if(isnull(cmdtext))
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            SetPlayerPos(playerid, X, Y, Z);
            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
            SendClientMessage(playerid, COLOR_GREY, "* Spawned Jetpack For Yourself. You Can Also Do /jetpack [id].");
        }
        else
        {
            new id, string[128], aname[24], pname[24];
           
            id = strval(cmdtext);
           
            if(!strlen(cmdtext)) return SendClientMessage(playerid, COLOR, "USAGE:  /jetpack [id] - Enter A Valid Player ID.");
           
            GetPlayerName(playerid,aname,24); // admin name
            GetPlayerName(id,pname,24); // player name

            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            SetPlayerPos(playerid, X, Y, Z);
            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
           
            format(string,128,"You Have Given  %s (%d)  A Jetpack.",pname,id); SendClientMessage(playerid, COLOR, string);
            format(string,128,"Administrator  %s (%d)  Has Given You A Jetpack.",aname,playerid); SendClientMessage(id, COLOR, string);
            return 1;
        }
    } else return SendClientMessage(playerid, 0xAA0000AA, "You Have To Be A Level 1338 Admin To Use This!");
}
If you don't have isnull defined, add it to the top of your script.

pawn Код:
#define isnull(%1) \
    ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
This is UNTESTED.
Reply


Messages In This Thread
Jetpack Command - by Ltz-boy - 12.08.2011, 15:59
Re: Jetpack Command - by [MG]Dimi - 12.08.2011, 16:01
Re: Jetpack Command - by Ltz-boy - 12.08.2011, 16:04
Re: Jetpack Command - by [MG]Dimi - 12.08.2011, 16:10
[No subject] - by Ltz-boy - 12.08.2011, 16:11
Re: Jetpack Command - by [MG]Dimi - 12.08.2011, 16:14
Re: Jetpack Command - by Ltz-boy - 12.08.2011, 16:17
Re: Jetpack Command - by grand.Theft.Otto - 12.08.2011, 16:23
Re: Jetpack Command - by Ltz-boy - 12.08.2011, 16:24
Re: Jetpack Command - by grand.Theft.Otto - 12.08.2011, 16:28

Forum Jump:


Users browsing this thread: 2 Guest(s)