/ta command [SIMPLE] -
PabloDiCostanzo - 18.10.2013
Greetings
Hello sa-mp today I was making the police system to my server when I complie I get this errors:
pawn Код:
C:\Users\usuario\Sa-Mp\gamemodes\Game.pwn(716) : warning 219: local variable "classid" shadows a variable at a preceding level
C:\Users\usuario\Sa-Mp\gamemodes\Game.pwn(766) : warning 211: possibly unintended assignment
C:\Users\usuario\Sa-Mp\gamemodes\Game.pwn(777) : error 035: argument type mismatch (argument 2)
C:\Users\usuario\Sa-Mp\gamemodes\Game.pwn(790) : error 017: undefined symbol "params"
C:\Users\usuario\Sa-Mp\gamemodes\Game.pwn(790) : warning 215: expression has no effect
C:\Users\usuario\Sa-Mp\gamemodes\Game.pwn(790) : error 001: expected token: ";", but found "]"
C:\Users\usuario\Sa-Mp\gamemodes\Game.pwn(790) : error 029: invalid expression, assumed zero
C:\Users\usuario\Sa-Mp\gamemodes\Game.pwn(790) : fatal error 107: too many error messages on one line
And this is all my whole script:
pawn Код:
new IsCop[MAX_PLAYERS];
CMD:ta(playerid, params[])
{
if(!sscanf(params, "u", params[0]))
{
if(!IsPlayerConnected(params[0]))
{
if(IsCop[playerid] = 1)
{
TogglePlayerControllable(params[0], 0);
{
new string[128];
format(string, sizeof(string), "{FF0000}TAZED: You have been tazed by cop %s for 2.5", GetName(playerid));
SendClientMessage(params[0], -1, string);
GameTextForPlayer(params[0], "~r~TAZED", 5000, 4);
format(string, sizeof(string), "TAZED: You have tazed the player %s for 2.5 seconds", GetName(params[0]));
SendClientMessage(playerid, COL_BLUE, string); //HERE
}
SetTimer("TazedPlayer", 25000, false);
} else SendClientMessage(playerid, -1, "{FF0000}ERROR: You are not a cop, you are not allowed to use this command");
} else SendClientMessage(playerid, -1, "ERROR: That player is not connected");
} else SendClientMessage(playerid, -1, "{878787}USAGE: /ta(ze) [id]");
return 1;
}
forward TazedPlayer();
public TazedPlayer()
{
TogglePlayerControllable(params[0], 1); // AND HERE SPECCIALY
{
GameTextForPlayer(params[0], "~r~UNTAZED", 5000, 4);
}
}
If anyone can help me,
Regards.
Pablo.
Re: /ta command [SIMPLE] -
bensmart469 - 18.10.2013
TogglePlayerControllable(params[0], 1); // AND HERE SPECCIALY
{
GameTextForPlayer(params[0], "~r~UNTAZED", 5000, 4);
}
Here should be:
TogglePlayerControllable(params[0], 1); // AND HERE SPECCIALY
GameTextForPlayer(params[0], "~r~UNTAZED", 5000, 4);
And did you #include <zcmd>?
Re: /ta command [SIMPLE] -
AnonScripter - 18.10.2013
here you got:
pawn Код:
new IsCop[MAX_PLAYERS];
CMD:ta(playerid, params[])
{
new string[128];
if(sscanf(params, "u", params[0])) return SendClientMessage(playerid, COLOR_WHITE, "/ta [playerid]");
if(!IsPlayerConnected(params[0]))return SendClientMessage(playerid, COLOR_WHITE, "Error: This player is not connected!");
if(params[0] == playerid) return SendClientMessage(playerid,COLOR_WHITE,"Error: You cannot taze yourself!");
if(IsCop[playerid] == 1)
{
TogglePlayerControllable(params[0], 0);
format(string, sizeof(string), "{FF0000}TAZED: You have been tazed by cop %s for 2.5", GetName(playerid));
SendClientMessage(params[0], -1, string);
GameTextForPlayer(params[0], "~r~TAZED", 5000, 4);
format(string, sizeof(string), "TAZED: You have tazed the player %s for 2.5 seconds", GetName(params[0]));
SendClientMessage(playerid, COLOR_BLUE, string); //HERE
SetTimer("TazedPlayer", 25000, false);
}
else
{
SendClientMessage(playerid, -1, "{FF0000}ERROR: You are not a cop, you are not allowed to use this command");
}
return 1;
}
forward TazedPlayer(playerid);
public TazedPlayer(playerid)
{
TogglePlayerControllable(playerid, 1); // AND HERE SPECCIALY
GameTextForPlayer(playerid, "~r~UNTAZED", 5000, 4);
return 1;
}