24.11.2014, 21:53
Hello all! I am trying to make my self a gamemode and i'm not that good yet at scripting. So I am now making the command /ban. As i was making it, i have found an error which didn't save the ban into the user's file.
It does ban him, but it just won't save.
Thanks in advance!
Here is my code:
It does ban him, but it just won't save.
Thanks in advance!
Here is my code:
Код:
CMD:ban(playerid, params[], help) { new id, reason[128], str1[128], str2[128],str3[128]; if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin]<=6) if (sscanf(params, "ds[128]", id, reason)) SendClientMessage(playerid, 0x2B63CCFF, "[G-Zone]: {E6E6E6}/ban [playerid] [reason]"); else if (!IsPlayerConnected(id)) SendClientMessage(playerid, 0xFFED2D3AFF, "Invalid id"); else { format(str1, 128, "Admin: %s Banned: %s Reason: %s", GetName(playerid),GetName(playerid), reason); SendClientMessageToAll(0xFFED2D3AFF,str1); format(str2, 128, "You have been Banned from the server by Admin: %s Reason: %s",GetName(playerid), reason); SendClientMessage(id, 0xFFED2D3AFF, str2); format(str3, 128, "~r~~h~Banned ~n~~r~"); GameTextForPlayer(id, str3, 6000, 3); PlayerInfo[playerid][pBanned]= 1; Kick(id); } else { SendClientMessage(playerid, 0xFFFFFFFF, "You are not authorized to use that command!"); } return 1; }