Warnings Get me Mad All Times -__-
#1

pawn Код:
C:\Users\carlo\Desktop\SA-MP Server\trucking\filterscripts\WindAdmin.pwn(621) : warning 225: unreachable code
C:\Users\carlo\Desktop\SA-MP Server\trucking\filterscripts\WindAdmin.pwn(624) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\carlo\Desktop\SA-MP Server\trucking\filterscripts\WindAdmin.pwn(612) : warning 204: symbol is assigned a value that is never used: "str"
C:\Users\carlo\Desktop\SA-MP Server\trucking\filterscripts\WindAdmin.pwn(611) : warning 203: symbol is never used: "id"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Warnings.
I Just Create This Command
pawn Код:
CMD:report(playerid,params[])
{
    new id, reported;
    new str[256];
    new tmp[256];
    if(isnull(params)) return
    SendClientMessage(playerid, LIGHTBLUE2, "Usage: /report [PlayerID] [Reason]") &&
    SendClientMessage(playerid, orange, "Attention: Not report anyone without Reason!");

    if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID)
    {
    return SendClientMessage(playerid,red,"ERROR: You cannot report this Administrator");
    if(playerid == reported) return SendClientMessage(playerid , red, "ERROR: You Cannot report Yourself");
    if(strlen(params) > 7)
        {
            new reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], str[128];
            new hour, minute, second;
            gettime(hour,minute, second);
            GetPlayerName(reported, reportedname, sizeof(reportedname));
            GetPlayerName(playerid, reporter, sizeof(reporter));
            format(str, sizeof(str), "REPORT: %s (Id:%d) Reported %s(Id:%d) Reason: %s |Time: %d : %d : %d|", reporter,playerid,reportedname,reported,params[strlen(tmp)+1], hour,minute,second);
            MessageToAdmins(COLOR_WHITE,str);
            SaveIn("ReportLog",str);
            format(str, sizeof(str), "(%d : %d : %d): %s(Id:%d) Reported %s(Id:%d) Reason: %s", hour,minute,second, reporter,playerid, reportedname, reported, params[strlen(tmp)+1]);
            return SendClientMessage(playerid,yellow, "|- Your report has been sent to Online Administrators and saved in File! -|");
        }
    }

    return 1;
}
Reply
#2

Try with this ...
PHP код:
CMD:report(playeridparams[])
{
    new 
reported;
    new 
string[256];
    new 
tmp[256];
    if(
isnull(params)) return
    
SendClientMessage(playeridLIGHTBLUE2"Usage: /report [PlayerID] [Reason]") &&
    
SendClientMessage(playeridorange"Attention: Not report anyone without Reason!");
     if(
IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID)
    {
    return 
SendClientMessage(playerid,red,"ERROR: You cannot report this Administrator");
    if(
playerid == reported) return SendClientMessage(playerid red"ERROR: You Cannot report Yourself");
    if(
strlen(params) > 7)
        {
            new 
reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], string[128];
            new 
hourminutesecond;
            
gettime(hour,minutesecond);
            
GetPlayerName(reportedreportednamesizeof(reportedname));
            
GetPlayerName(playeridreportersizeof(reporter));
            
format(strsizeof(str), "REPORT: %s (Id:%d) Reported %s(Id:%d) Reason: %s |Time: %d : %d : %d|"reporter,playerid,reportedname,reported,params[strlen(tmp)+1], hour,minute,second);
            
MessageToAdmins(COLOR_WHITE,str);
            
SaveIn("ReportLog",string);
            
format(stringsizeof(string), "(%d : %d : %d): %s(Id:%d) Reported %s(Id:%d) Reason: %s"hour,minute,secondreporter,playeridreportednamereportedparams[strlen(tmp)+1]);
            return 
SendClientMessage(playerid,yellow"|- Your report has been sent to Online Administrators and saved in File! -|");
        }
    }
    return 
1;

Reply
#3

Lol The Four Warning Turn Into 4 Errors
Sorry Try Again
Reply
#4

post the error
Reply
#5

this will work fine, compiled and tested it
pawn Код:
CMD:report(playerid,params[])
{
new reported;
new tmp[256];
if(isnull(params)) return
SendClientMessage(playerid, -1, "Usage: /report [PlayerID] [Reason]") &&
SendClientMessage(playerid, orange, "Attention: Not report anyone without Reason!");
if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID){
SendClientMessage(playerid,red,"ERROR: You cannot report this Administrator"); }
if(playerid == reported) return SendClientMessage(playerid , red, "ERROR: You Cannot report Yourself");
if(strlen(params) > 7) {
new reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], str[128];
new hour, minute, second;
gettime(hour,minute, second);
GetPlayerName(reported, reportedname, sizeof(reportedname));
GetPlayerName(playerid, reporter, sizeof(reporter));
format(str, sizeof(str), "REPORT: %s (Id:%d) Reported %s(Id:%d) Reason: %s |Time: %d : %d : %d|", reporter,playerid,reportedname,reported,params[strlen(tmp)+1], hour,minute,second);
MessageToAdmins(COLOR_WHITE,str);
SaveIn("ReportLog",str);
format(str, sizeof(str), "(%d : %d : %d): %s(Id:%d) Reported %s(Id:%d) Reason: %s", hour,minute,second, reporter,playerid, reportedname, reported, params[strlen(tmp)+1]);
return SendClientMessage(playerid,yellow, "|- Your report has been sent to Online Administrators and saved in File! -|");
}
return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)