13.09.2012, 17:06
I want my target to taze for 5 seconds and I need a timer right, how?
pawn Код:
dcmd_taze(playerid, params[])
{
if(AccInfo[playerid][pVip] >= 1)
{
new targetid, string[128];
new playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(targetid, targetname, sizeof(targetname));
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, white, "{FFFF00}Usage: /taze [PlayerID]");
else if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, white, "{FF0000}>> Invalid Player ID");
else if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, white, "{FF0000}>> You must step out the vehicle to use your tazer");
else if(GetPVarInt(playerid, "Jailed") == 1) return GameTextForPlayer(playerid,"Player is Jailed",2000,3);
else if(Tazed[targetid] == 1)
{
format(string, sizeof(string), "{FF0000}>> %s(%d) is being tazed right now", targetname, targetid);
SendClientMessage(playerid, white, string);
}
else if(IsPlayerInAnyVehicle(targetid))
{
format(string, sizeof(string), "{FF0000}>> %s(%d) is in a vehicle", targetname, targetid);
SendClientMessage(playerid, white, string);
return 1;
}
else if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, white, "{FF0000}>> You cannot taze a player from inside a vehicle");
return 1;
}
else
{
Tazed[targetid] =1;
TogglePlayerControllable(targetid, 0);
ApplyAnimation(targetid,"CRACK","crckdeth2",4.1,1,1,1,1,1);
return 1;
}
}
else return ErrorMessages(playerid, 1);
return 1;
}