20.12.2015, 16:04
this is my kick code but given me 2 error and i cant fix it.can you help me?
Код:
CMD:kick(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >=2 || IsPlayerAdmin(playerid)) { new id,reason[64], str[128], adminname[MAX_PLAYER_NAME], victimname[MAX_PLAYER_NAME], kid; if(sscanf(params, "us[64]", id,reason))return SendClientMessage(playerid, COLOR_RED, "USAGE: /kick [ID] [Reason]"); if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "[Error]: You can not kicked yourself!"); if(PlayerInfo[id][pAdmin] >= PlayerInfo[playerid][pAdmin] || IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_RED, "[Error]: You can not kicked higher admins!"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "[ERROR]:Invalid ID"); GetPlayerName(playerid, adminname, sizeof(adminname)); GetPlayerName(kid, victimname, sizeof(victimname)); if(PlayerInfo[playerid][pKick] ==1) { format(str, sizeof(str), "[KICK] Admin %s (id:%d) kicked %s (id:%d) from the server.Reason: [1 of 3 kick] %s.", adminname, playerid, victimname, kid, reason); SendClientMessageToAll(COLOR_RED, str); if(PlayerInfo[playerid][pKick] +=1 GameTextForPlayer(id, "~r~You have been kicked!", 5000, 4); Kick(id); return 1; } if(PlayerInfo[playerid][pKick] ==2) { format(str, sizeof(str), "[KICK] Admin %s (id:%d) kicked %s (id:%d) from the server.Reason: [2 of 3 kick] %s.", adminname, playerid, victimname, kid, reason); SendClientMessageToAll(COLOR_RED, str); if(PlayerInfo[playerid][pKick] +=1 GameTextForPlayer(id, "~r~You have been kicked!", 5000, 4); Kick(id); return 1; } if(PlayerInfo[playerid][pKick] ==3) { new filestring[79]; format(filestring, sizeof(filestring), "/Asystem/Users/%s.ini", kid); format(str, sizeof(str), "[KICK] Admin %s (id:%d) banned %s (id:%d) from the server.Reason: [3 of 3 kick] %s.", adminname, playerid, victimname, kid, reason); SendClientMessageToAll(COLOR_RED, str); new INI:File = INI_Open(filestring); INI_SetTag(File, "data"); INI_WriteInt(File, "pBan", 1); INI_Close(File); GameTextForPlayer(id, "~r~You have been banned!", 5000, 4); return 1; } return 1; } else return SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!"); }
Код:
C:\Users\Aref\Desktop\Aref\sampserver\pawno\CODv2.pwn(1606) : error 001: expected token: ")", but found "-identifier-" C:\Users\Aref\Desktop\Aref\sampserver\pawno\CODv2.pwn(1615) : error 001: expected token: ")", but found "-identifier-"
Код:
1606 = GameTextForPlayer(id, "~r~You have been kicked!", 5000, 4); in player info = 1 kick 1601 = Kick(id); in player info = 2 kick