12.08.2011, 16:23
I made this so you can give it to a player..
If you don't have isnull defined, add it to the top of your script.
This is UNTESTED.
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!");
}
pawn Код:
#define isnull(%1) \
((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))