13.06.2015, 11:27
Код:
CMD:mute(playerid, params[]) { if (adlvl[playerid] < 1) return 0; tmp = strtok(cmdtext, idx); if (!strlen(tmp)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /mute [playerid] [time]"); giveplayerid = strval(tmp); tmp2 = strtok(cmdtext, idx); if (!strlen(tmp2)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /mute [playerid] [time]"); moneys1 = strval(tmp2); if (!IsPlayerConnected2(giveplayerid) || !isNumeric(tmp)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!"); if (moneys1 < 1 || moneys1 > 60) return SendClientMessage2(playerid, COLOR_WHITE, "Error: Select a time between 1-60 minutes."); if (giveplayerid == playerid) return SendClientMessage2(playerid, COLOR_RED, "Error: You can't mute yourself!"); GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME); if (adlvl[giveplayerid] >= adlvl[playerid] && adminuc[giveplayerid] == 0) return SendPlayerFormattedText(playerid, COLOR_RED, "Error: You cannot mute %s.", giveplayer, ""); if (mtimer[giveplayerid] != 0) return SendPlayerFormattedText(playerid, COLOR_RED, "Error: %s is already muted.", giveplayer, ""); if (moneys1 < 1 || moneys1 > 60) return SendClientMessage2(playerid, COLOR_WHITE, "Error: Select a time between 1-60 minutes."); GetPlayerName(playerid, playername, MAX_PLAYER_NAME); mtimer[giveplayerid] = SetTimerEx("unmute", moneys1*60000, 0, "d", giveplayerid); SendClientMessage2(giveplayerid, COLOR_RED, "You have been muted by an admin."); SendPlayerFormattedText(playerid, COLOR_RED, "You have muted %s.", giveplayer, ""); if (adminuc[playerid] == 0) { format(string, 128, "Admin Log: %s has muted player %s (Id%d) for %d minute(s).", playername, giveplayer, giveplayerid, moneys1); SendMessageToAdmins(COLOR_ADMIN, string); } printf("[muted] %s has muted player %s (Id%d) for %d minutes.", playername, giveplayer, giveplayerid, moneys1); return 1; }
But there is a lot of undefined words, tried to use new
or #define but both not worked!
HELP!
Код:
D:\My server\gamemodes\TDM_Script.pwn(1413) : error 017: undefined symbol "tmp" D:\My server\gamemodes\TDM_Script.pwn(1413) : error 017: undefined symbol "strtok" D:\My server\gamemodes\TDM_Script.pwn(1414) : error 017: undefined symbol "tmp" D:\My server\gamemodes\TDM_Script.pwn(1415) : error 017: undefined symbol "giveplayerid" D:\My server\gamemodes\TDM_Script.pwn(1415) : error 017: undefined symbol "tmp" D:\My server\gamemodes\TDM_Script.pwn(1416) : error 017: undefined symbol "tmp2" D:\My server\gamemodes\TDM_Script.pwn(1416) : error 017: undefined symbol "strtok" D:\My server\gamemodes\TDM_Script.pwn(1417) : error 017: undefined symbol "tmp2" D:\My server\gamemodes\TDM_Script.pwn(1418) : error 017: undefined symbol "moneys1" D:\My server\gamemodes\TDM_Script.pwn(1418) : error 017: undefined symbol "tmp2" D:\My server\gamemodes\TDM_Script.pwn(1419) : error 017: undefined symbol "giveplayerid" D:\My server\gamemodes\TDM_Script.pwn(1421) : error 017: undefined symbol "moneys1" D:\My server\gamemodes\TDM_Script.pwn(1423) : error 017: undefined symbol "giveplayerid" D:\My server\gamemodes\TDM_Script.pwn(1425) : error 017: undefined symbol "giveplayerid" D:\My server\gamemodes\TDM_Script.pwn(1426) : error 017: undefined symbol "giveplayerid" D:\My server\gamemodes\TDM_Script.pwn(1427) : error 017: undefined symbol "giveplayer" D:\My server\gamemodes\TDM_Script.pwn(1428) : error 017: undefined symbol "mtimer" D:\My server\gamemodes\TDM_Script.pwn(1428) : error 017: undefined symbol "giveplayerid" D:\My server\gamemodes\TDM_Script.pwn(1428) : error 029: invalid expression, assumed zero D:\My server\gamemodes\TDM_Script.pwn(1428) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 20 Errors.