08.08.2017, 17:43
Hello, I need help, I create a command to ban offline, but it gives me an error maybe they could help me.
The error
Код:
CMD:offlineban(playerid, params[], help) { if(help) { SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Command /offlineban: {FFFFFF}Bans a player who is offline."); } else { if(pInfo[playerid][pLogged] == 0) return 0; if(pInfo[playerid][pAdminLevel] >= 4) { new string[158], reason[120], targetname[24], filestring[79]; if(sscanf(params, "s[24]s[120]", targetname, reason)) return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Syntax: {FFFFFF}/offlineban [fullname] [reason]"); GetPlayerName(playerid, sendername, sizeof(sendername)); // Here in this line is where I throw the error. format(filestring, sizeof(filestring), "/ZMA/Users/%s.ini", targetname); if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Error: {FFFFFF}Player doesn't exist."); else { new INI:File = INI_Open(filestring)); INI_SetTag(File, "data"); INI_RemoveEntry(File, "Banned"); INI_WriteInt(File, "Banned", 1); INI_Close(File); format(string, sizeof(string),"{FF6347}Admin %s banned the offline player %s, reason: %s", sendername, targetname, reason); SendClientMessageToAll(COLOR_WHITE, string); } } else { SendClientMessage(playerid, COLOR_WHITE, ""MinimumAdmin1""); return 1; } } return 1; }
The error
Код:
D:\Program Files\PROYECTO GM ZOMBIE PROXIMAMENTE - ASISTENTES JANSELK THORO DEAD MAU SREMMURD\Zombie Nightmare\gamemodes\zmazombie.pwn(3427) : error 017: undefined symbol "sendername" D:\Program Files\PROYECTO GM ZOMBIE PROXIMAMENTE - ASISTENTES JANSELK THORO DEAD MAU SREMMURD\Zombie Nightmare\gamemodes\zmazombie.pwn(3427) : error 017: undefined symbol "sendername" D:\Program Files\PROYECTO GM ZOMBIE PROXIMAMENTE - ASISTENTES JANSELK THORO DEAD MAU SREMMURD\Zombie Nightmare\gamemodes\zmazombie.pwn(3427) : error 029: invalid expression, assumed zero D:\Program Files\PROYECTO GM ZOMBIE PROXIMAMENTE - ASISTENTES JANSELK THORO DEAD MAU SREMMURD\Zombie Nightmare\gamemodes\zmazombie.pwn(3427) : fatal error 107: too many error messages on one line