03.07.2013, 10:35
Command with error
Whole callback with warning
Error & Warnıng
Error Line
Warning Line
pawn Код:
CMD:warn(playerid, params[])
{
new targetid, reason, string[128];
if(sscanf(params, "uc", targetid, reason)) return SendClientMessage(playerid, -1, "USAGE: /warn [playerid] [reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "ERROR: Player isn't connected.");
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "You're either not admin or your admin level is not high enough!");
{
format(string, sizeof(string), "Player %s has recieved a warning from admin %s, reason: %s", GetName(targetid), GetName(playerid), reason);
SendClientMessageToAll(-1, string);
PlayerInfo[targetid][pWarnings] = ++;
}
return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
new
name[MAX_PLAYER_NAME]; // Create variable to hold name.
GetPlayerName(playerid, name, sizeof(name)); // Use GetPlayername to store the player with playerid's name to the variable //above. Then use that variable with your stock.
if(RoleplayNameCheck(name))
{
SendClientMessage(playerid, -1, COLOR_RED"Your name is not in the Firstname_Lastname format! "COLOR_WHITE"Please correct it.");
Kick(playerid);
}
return 1;
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_WHITE"Type your password below to login.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_WHITE"Registering...",""COLOR_WHITE"Type your password below to register a new account.","Register","Quit");
}
return 1;
}
Код:
E:\samp03x_svr_R1-2_win32\pawno\Roleplay.pwn(734) : error 029: invalid expression, assumed zero E:\samp03x_svr_R1-2_win32\pawno\Roleplay.pwn(1097) : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
pawn Код:
PlayerInfo[targetid][pWarnings] = ++;
pawn Код:
if(fexist(UserPath(playerid)))