07.02.2015, 14:26
I've created an /givegold but the server will crash after using this command, whats the problem?
pawn Код:
CMD:givegold(playerid, params[])
{
static
userid,
amount;
if (PlayerData[playerid][pAdmin] > 6)
return SendErrorMessage(playerid, "You don't have permission to use this command.");
if(sscanf(params, "ud", userid, amount))
return SendSyntaxMessage(playerid, "/givegold [playerid/name] [amount]");
if (userid == INVALID_PLAYER_ID)
return SendErrorMessage(playerid, "You have specified an invalid player.");
PlayerData[playerid][pGold] = amount;
SendClientMessageEx(playerid, COLOR_PINK, "Admin %s has transeferd %d gold points to your account", amount);
SendAdminAlert(COLOR_LIGHTRED, "[ADMIN]: %s has given %s to %s.", ReturnName(playerid, 0), FormatNumber(amount), ReturnName(userid, 0));
Log_Write("logs/admin_log.txt", "[%s] %s has given %s to %s.", ReturnDate(), ReturnName(playerid, 0), FormatNumber(amount), ReturnName(userid, 0));
return 1;
}
FIXED, HUMAN MISTAKES