27.12.2013, 21:28
pawn Код:
new HaveTaser[MAX_PLAYERS]; //topo gm
HaveTaser[playerid] = 0; //mete isto dentro da public OnPlayerConnect
if(strcmp(cmd, "/tazer", true) ==0) //Este comando em OnPlayerCommandText
{
if(IsPlayerConnected(playerid))
{
if(HaveTaser[playerid] == 0)
{
PlayerActionMessage(playerid,15.0,"saca rapidamente do tazer e prepara-se para o usar");
SetPlayerAttachedObject(playerid, 2, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0);
HaveTaser[playerid] = 1;
}
else
{
PlayerActionMessage(playerid,15.0,"guarda o tazer");
RemovePlayerAttachedObject(playerid, 2);
HaveTaser[playerid] = 0;
}
}//not connected
return 1;
}