C:\Users\selma\Desktop\Samp\gamemodes\Lerenscripte n.pwn(576) : error 003: declaration of a local variable must appear in a compound block C:\Users\selma\Desktop\Samp\gamemodes\Lerenscripte n.pwn(576) : error 017: undefined symbol "target" C:\Users\selma\Desktop\Samp\gamemodes\Lerenscripte n.pwn(576) : warning 215: expression has no effect C:\Users\selma\Desktop\Samp\gamemodes\Lerenscripte n.pwn(577) : error 017: undefined symbol "target" C:\Users\selma\Desktop\Samp\gamemodes\Lerenscripte n.pwn(579) : error 017: undefined symbol "target" C:\Users\selma\Desktop\Samp\gamemodes\Lerenscripte n.pwn(581) : error 017: undefined symbol "target" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors. |
CMD:resetweapon(playerid, params[])
{
if (!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, -1, "SERVER: Unknown command.");
}
else if (IsPlayerAdmin(playerid))
new target;
if(sscanf(params, "i", target))
SendClientMessage(playerid, COLOR_WARN, "USAGE: /resetweapon [playerid]");
ResetPlayerWeapons(target);
SendClientMessage(playerid, COLOR_WARN, "You removed the player's weapon.");
SendClientMessage(target, COLOR_RED, "You have been disarmed!");
return 1;
}
CMD:resetweapon(playerid, params[])
{
// You don't always need to use callbacks, you can simply do this:
if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "SERVER: Unknown command.");
// Doing this will also prevent you from requiring an "else if" function.
new target;
// Instead of "i" (which is integer), we use "u" (user) so we can use player's names aswell and then return the message aswell.
if(sscanf(params, "u", target)) return SendClientMessage(playerid, COLOR_WARN, "USAGE: /resetweapon [playerid]");
ResetPlayerWeapons(target);
SendClientMessage(playerid, COLOR_WARN, "You removed the player's weapon.");
SendClientMessage(target, COLOR_RED, "You have been disarmed!");
return 1;
}
CMD:resetweapon(playerid, params[])
{
new target;
if(sscanf(params, "u", target))
{
SendClientMessage(playerid, COLOR_WARN, "USAGE: /resetweapon [playerid]");
}
if (!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, -1, "SERVER: Unknown command.");
}
else if(IsPlayerAdmin(playerid))
{
ResetPlayerWeapons(target);
SendClientMessage(playerid, COLOR_WARN, "You removed the player's weapon.");
SendClientMessage(target, COLOR_RED, "You have been disarmed!");
}
return 1;
}
CMD:resetweapon(playerid, params[])
{
if (!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, -1, "SERVER: Unknown command.");
return 1;
}
new target;
if(sscanf(params, "i", target))
SendClientMessage(playerid, COLOR_WARN, "USAGE: /resetweapon [playerid]");
ResetPlayerWeapons(target);
SendClientMessage(playerid, COLOR_WARN, "You removed the player's weapon.");
SendClientMessage(target, COLOR_RED, "You have been disarmed!");
return 1;
}
Originally Posted by SAMP Wiki
players are special so we can use 'u' so people can enter their name OR ID.
|
Specifiers "s" - Strings "q", "r", "u" - Users "f" - Float "h" - Hex "i" - Integer |