25.11.2011, 10:34
Facil:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/jetpack", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreatePickup(370,3,X,Y,Z);
SendClientMessage(playerid,0x80FF00AA,"| INFO | Vocк criou um JetPack.");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
return 1;
}
}
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
}
}
return 1;
}