CMD:eventprize(playerid, params[]) { new string[128], playerb, prize,; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); if(sscanf(params, "ui", playerb, event)) { SendClientMessage(playerid, COLOR_WHITE, "/setstat [playerid] [prizeid]"); SendClientMessage(playerid, COLOR_GREY, "Prizes: 1 | 2"); return 1; } if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id."); switch(stat) { case 1: { GiveZaiatMoney(playerid, 50000); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); format(string, sizeof(string), "%s has givin %s $50,000 and full health and armor", RPN(playerid), RPN(playerb)); SendClientMessageToAll(COLOR_LIGHTRED, string); } } Log("logs/eventprize.log", string); return 1; }
C:\Users\Michael\Desktop\*\other\GTA\My server\ARP\gamemodes\ARP.pwn(3431) : error 001: expected token: "-identifier-", but found ";" C:\Users\Michael\Desktop\*\other\GTA\My server\ARP\gamemodes\ARP.pwn(3434) : error 017: undefined symbol "event" C:\Users\Michael\Desktop\*\other\GTA\My server\ARP\gamemodes\ARP.pwn(3441) : error 017: undefined symbol "stat" C:\Users\Michael\Desktop\*\other\GTA\My server\ARP\gamemodes\ARP.pwn(3431) : warning 203: symbol is never used: "prize" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
C:\Users\Michael\Desktop\*\other\GTA\My server\ARP\gamemodes\ARP.pwn(3434) : error 017: undefined symbol "event" C:\Users\Michael\Desktop\*\other\GTA\My server\ARP\gamemodes\ARP.pwn(3441) : error 017: undefined symbol "stat" C:\Users\Michael\Desktop\*\other\GTA\My server\ARP\gamemodes\ARP.pwn(3431) : warning 203: symbol is never used: "prize" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
CMD:eventprize(playerid, params[])
{
new string[128], playerb, event; //Prize is not needed, event is.
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "ui", playerb, event))
{
SendClientMessage(playerid, COLOR_WHITE, "/setstat [playerid] [prizeid]");
SendClientMessage(playerid, COLOR_GREY, "Prizes: 1 | 2");
return 1;
}
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
switch(event) //Switching on Event, not "Stat", as there is no such thing as "Stat" defined.
{
case 1:
{
GiveZaiatMoney(playerb, 50000); //This
SetPlayerHealth(playerb, 100); //This
SetPlayerArmour(playerb, 100); //And this were wrong, you're giving the prize to playerb, not the player who types in the command.
format(string, sizeof(string), "%s has givin %s $50,000 and full health and armor", RPN(playerid), RPN(playerb));
SendClientMessageToAll(COLOR_LIGHTRED, string);
}//Where's case 2?
}
Log("logs/eventprize.log", string);
return 1;
}
pawn Код:
|