14.09.2009, 11:20
Whole Code:
Line Erroring:
return 1; }}
Error Code:
C:\Documents and Settings\EPRP (3).pwn(880) : warning 209: function "dcmd_warn" should return a value
Код:
dcmd_warn(playerid,params[]) { new str[128], reason[128]; new giveplayerid; if(PlayerInfo[playerid][pAdmin] == 0) return SystemMsg(playerid, "You must be a admin to use this command!"); if(sscanf(params, "us", giveplayerid, reason)) return SystemMsg(playerid, " Usage : /warn [playerid / name] [reason]"); if(!IsPlayerConnected(giveplayerid)) return SystemMsg(playerid, "That player is not connected!"); format(str, sizeof(str), "ADMIN %s has warned %s [Reason: %s]", PlayerName(playerid), PlayerName(giveplayerid), reason); SendClientMessageToAll(COLOR_RED, str); PlayerInfo[giveplayerid][pWarns]++; dUserSetINT(PlayerName(playerid)).("pWarns",PlayerInfo[playerid][pWarns]); new str2[MAX_STRING], second, minute, hour, day, month, year; gettime(hour, minute, second); getdate(year, month, day); format(str2, sizeof(str2), "ADMIN %s (%s) warned %s (%s) on %d/%d/%d at %d:%d:%d. (Reason: '%s')", PlayerName(playerid), GetIp(playerid), PlayerName(giveplayerid), GetIp(giveplayerid), month, day, year, hour, minute, second, reason); AdminLog(str2); if(PlayerInfo[playerid][pWarns] == 3) { PlayerInfo[playerid][pBanned] = 1; format(str, sizeof(str), "..: SERVER kicked %s. Reason: Reached 3 Warnings :..", PlayerName(playerid)); SendClientMessageToAll(COLOR_RED, str); new str3[MAX_STRING]; gettime(hour, minute, second); getdate(year, month, day); format(str3, sizeof(str3), "PLAYER %s (%s) got auto-banned on %d/%d/%d at %d:%d:%d. (Reason: 'Reached 3 Warnings')", PlayerName(playerid), GetIp(playerid), month, day, year, hour, minute, second); return 1; }}
return 1; }}
Error Code:
C:\Documents and Settings\EPRP (3).pwn(880) : warning 209: function "dcmd_warn" should return a value