30.05.2010, 19:39
Hello again,
I have a question with my /warn command. I use dcmd_warn and I nearly script it to the end. Now I have a little problem and I dunno how to fix it.
When I type in the command it shows me "...Reason: bla bla Warns: 3/3. But I only type 1 warning and it shows me that i have 3 warns --> 3/3.
How can I fix that?
And it seems that the server donґt kick the player automatically when it reach 3 warns? Also help pls
Also it seems that when I warn a player the year, month and so on donґt display.
So I need help!
I have a question with my /warn command. I use dcmd_warn and I nearly script it to the end. Now I have a little problem and I dunno how to fix it.
Код:
dcmd_warn(playerid,params[]) { new year, month, day; getdate(year, month, day); new hour, minute, second; gettime(hour, minute, second); new ReturnPlayer, pName[24], ReturnUserName[24], str[128], Reason[128], string[256]; { if(PlayerInfo[playerid][AdminLevel] < 1) return false; if(sscanf(params,"ds",ReturnPlayer,Reason)) return SendClientMessage(playerid, COLOR_WHITE,"USAGE: /warn [playerid] [reason]"); if (!IsPlayerConnected(ReturnPlayer)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Invalid playerID!"); GetPlayerName(playerid, pName, sizeof(pName)); GetPlayerName(ReturnPlayer, ReturnUserName, sizeof(ReturnUserName)); format(str,sizeof(str),"ADMIN: %s has been warned by Administrator %s [Reason: %s] (%d/3)",ReturnUserName, pName, Reason,warnings); SendClientMessageToAll(COLOR_BRIGHTRED, str); format(str,sizeof(str),"%s has been warned by Administrator %s [Reason: %s] (Warns: %d/3) (%d.%d.%d)",ReturnUserName, pName, Reason,warnings, year, month, day); format(str, sizeof(str), "ADMIN: %s (ID: %d) has warned %s (ID: %d) Reason: %s", pName, playerid, ReturnUserName, ReturnPlayer, Reason); SendAdminMsg(COLOR_WHITE, str); return 1; } if(PlayerInfo[playerid][Warnings] == 3) { new File:KickFile = fopen("logs/KickLog.txt", io_append); SendClientMessage(playerid, COLOR_BRIGHTRED, "You have been automatically kicked. Reason: (3 Warnings)"); format(str, sizeof(str), "[Server] %s has been kicked by Administrator %s [Reason: 3 Warnings]", ReturnUserName, pName); format(str,sizeof(str),"[Server] %s has been kicked by Administrator %s [Reason: 3 Warnings] (%d.%d.%d || %d:%d:%d)",ReturnUserName, pName, year, month, day); fwrite(KickFile, string); fclose(KickFile); } return 1; }
How can I fix that?
And it seems that the server donґt kick the player automatically when it reach 3 warns? Also help pls
Also it seems that when I warn a player the year, month and so on donґt display.
So I need help!