08.09.2012, 23:17
@Wolfmaster: You've declared a variable that you've never used and other things. Here, I've fixed the code a bit:
pawn Code:
dcmd_tazer(playerid, params[])
{
new Float:X, Float:Y, Float:Z, player1;
if(sscanf(params,"u", player1)) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] USAGE: /tazer [id]");
if(player1 == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] This player is offline!");
if(IsCuffed[player1] == 1) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] This player already shocked!");
if(gTeam[playerid] != TEAM_COP && gTeam[playerid] != SWAT)
{
SendClientMessage(playerid,COLOR_RED,"You are not a Police Unit!");
return 1;
}
GetPlayerPos(player1, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 20.0, X, Y, Z))
{
TogglePlayerControllable(player1, false);
IsTazed[player1] = 1;
GameTextForPlayer(player1, "~r~ Shocked!", 4000, 4);
SetTimerEx("tazertimer", 7000, false, "u", player1);
SendClientMessage(playerid, 0xFF0000AA, "{00FF00}[SUCCESSFUL SHOCKED!]");
SendClientMessage(player1, 0xFF0000AA, "{FF0000}You have shocked by a Police Unit!");
}
return 1;
}