error 001: expected token: "-string end-", but found "-identifier-"
#1

Код:
C:\Users\Matt\Desktop\SAMP\scatrucking\gamemodes\scatrucking.pwn(8571) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Matt\Desktop\SAMP\scatrucking\gamemodes\scatrucking.pwn(8571) : warning 215: expression has no effect
C:\Users\Matt\Desktop\SAMP\scatrucking\gamemodes\scatrucking.pwn(8571) : error 001: expected token: ";", but found "-string-"
C:\Users\Matt\Desktop\SAMP\scatrucking\gamemodes\scatrucking.pwn(8571) : warning 215: expression has no effect
C:\Users\Matt\Desktop\SAMP\scatrucking\gamemodes\scatrucking.pwn(8571) : error 001: expected token: ";", but found ")"
C:\Users\Matt\Desktop\SAMP\scatrucking\gamemodes\scatrucking.pwn(8571) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
pawn Код:
if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, red, "PHT-BOT:"green2" /warn [playerid] [reason]");
pawn Код:
CMD:warn(playerid, params[])
{
    new str[128], id, reason[128];
    if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
    {
        if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, red, "PHT-BOT:"green2" /warn [playerid] [reason]");
        if(id == playerid) return SendClientMessage(playerid, red, "PHT-BOT:"green2" You cannot warn yourself");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, red, "PHT-BOT:"lred" Player not connected!");
        if(pInfo[id][Warn] == MAX_WARNINGS)
        {
            format(str, sizeof(str), "%s(%d) has been kicked [Reason: Reach the Maxium Warnings!]", GetName(id), id);
            SendClientMessageToAll(red, str);
            SendClientMessage(id, lred, "You've been kicked [Reason: Reach the Maxium Warnings!]");
            return Kick(id);
        }
        pInfo[id][Warn] += 1;
        format(str, sizeof(str), "Administrator/VIP %s(%d) warns %s(%d) [Reason: %s] [Warnings: %d/%d]", GetName(playerid), playerid, GetName(id), id, reason, pInfo[id][Warn], MAX_WARNINGS);
        SendClientMessageToAll(yellow, str);
        format(str, sizeof(str), "You warned %s(%d) [Reason: %s] [Warnings: %d/%d]", GetName(id), id, reason, pInfo[id][Warn], MAX_WARNINGS);
        SendClientMessage(playerid, green, str);
        format(str, sizeof(str), "You've been warned by Administrator/VIP %s(%d) [Reason: %s] [Warnings: %d/%d]", GetName(playerid), playerid, reason, pInfo[id][Warn], MAX_WARNINGS);
        SendClientMessage(id, red, str);
        format(str, sizeof(str), "warn %s %s", GetName(id), reason);
        SendAdminCMD(playerid, str);
    }
    else return SendClientMessage(playerid, lred, error);
    return 1;
}
Reply
#2

Use embedded colors instead of green2,lred ect.. and try to compile
Reply
#3

green2 is defined as integer when it should be defined as string:
pawn Код:
#define green2 "{00FF00}"
Reply
#4

Error;
PHP код:
C:\Users\Matt\Desktop\SAMP\scatrucking\gamemodes\scatrucking.pwn(6019) : error 028invalid subscript (not an array or too many subscripts): "pinfo2"
C:\Users\Matt\Desktop\SAMP\scatrucking\gamemodes\scatrucking.pwn(6019) : warning 215expression has no effect
C
:\Users\Matt\Desktop\SAMP\scatrucking\gamemodes\scatrucking.pwn(6019) : error 001expected token";"but found "]"
C:\Users\Matt\Desktop\SAMP\scatrucking\gamemodes\scatrucking.pwn(6019) : error 029invalid expressionassumed zero
C
:\Users\Matt\Desktop\SAMP\scatrucking\gamemodes\scatrucking.pwn(6019) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

Line;
PHP код:
if(pinfo2[id][Warn] == MAX_WARNINGS
enumarator;
PHP код:
enum pinfo2
{
    
Logged,
    
Level,
    
Missionsfailed,
    
Missionspassed,
    
Failedlogins,
    
hasfuelcan,
    
hasphone,
    
called,
    
answerd,
    
rescue,
    
beenrescued,
    
arrestedppl,
    
Jailed,
    
Frozen,
    
wantedlevel,
    
fare2,
    
onduty,
    
calledtaxi,
    
hasgps,
    
depositcash,
    
Isbanned,
    
Warn
}; 
Reply
#5

pawn Код:
CMD:warn(playerid, params[])
{
    new str[128], id, reason[128];
    if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
    if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, red, "PHT-BOT: {00FF00}/warn [playerid] [reason]");
    if(id == playerid) return SendClientMessage(playerid, red, "PHT-BOT: {00FF00}You cannot warn yourself");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, red, "PHT-BOT: {FF0000}Player not connected!");
    if(pInfo[id][Warn] == MAX_WARNINGS)
    {
        format(str, sizeof(str), "%s(%d) has been kicked [Reason: Reach the Maxium Warnings!]", GetName(id), id);
        SendClientMessageToAll(red, str);
        SendClientMessage(id, lred, "You've been kicked [Reason: Reach the Maxium Warnings!]");
        Kick(id);
        return 1;
    }
    pInfo[id][Warn] += 1;
    format(str, sizeof(str), "Administrator/VIP %s(%d) warns %s(%d) [Reason: %s] [Warnings: %d/%d]", GetName(playerid), playerid, GetName(id), id, reason, pInfo[id][Warn], MAX_WARNINGS);
    SendClientMessageToAll(yellow, str);
    format(str, sizeof(str), "You warned %s(%d) [Reason: %s] [Warnings: %d/%d]", GetName(id), id, reason, pInfo[id][Warn], MAX_WARNINGS);
    SendClientMessage(playerid, green, str);
    format(str, sizeof(str), "You've been warned by Administrator/VIP %s(%d) [Reason: %s] [Warnings: %d/%d]", GetName(playerid), playerid, reason, pInfo[id][Warn], MAX_WARNINGS);
    SendClientMessage(id, red, str);
    format(str, sizeof(str), "warn %s %s", GetName(id), reason);
    SendAdminCMD(playerid, str);
    return 1;
}
Reply
#6

not working same errors
Reply
#7

Try now:
pawn Код:
CMD:warn(playerid, params[])
{
    new str[128], id, reason[128];
    if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
    if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, red, "PHT-BOT: {00FF00}/warn [playerid] [reason]");
    if(id == playerid) return SendClientMessage(playerid, red, "PHT-BOT: {00FF00}You cannot warn yourself");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, red, "PHT-BOT: {FF0000}Player not connected!");
    if(pInfo2[id][Warn] == MAX_WARNINGS)
    {
        format(str, sizeof(str), "%s(%d) has been kicked [Reason: Reach the Maxium Warnings!]", GetName(id), id);
        SendClientMessageToAll(red, str);
        SendClientMessage(id, lred, "You've been kicked [Reason: Reach the Maxium Warnings!]");
        Kick(id);
        return 1;
    }
    pInfo2[id][Warn] ++;
    format(str, sizeof(str), "Administrator/VIP %s(%d) warns %s(%d) [Reason: %s] [Warnings: %d/%d]", GetName(playerid), playerid, GetName(id), id, reason, pInfo[id][Warn], MAX_WARNINGS);
    SendClientMessageToAll(yellow, str);
    format(str, sizeof(str), "You warned %s(%d) [Reason: %s] [Warnings: %d/%d]", GetName(id), id, reason, pInfo[id][Warn], MAX_WARNINGS);
    SendClientMessage(playerid, green, str);
    format(str, sizeof(str), "You've been warned by Administrator/VIP %s(%d) [Reason: %s] [Warnings: %d/%d]", GetName(playerid), playerid, reason, pInfo[id][Warn], MAX_WARNINGS);
    SendClientMessage(id, red, str);
    format(str, sizeof(str), "warn %s %s", GetName(id), reason);
    SendAdminCMD(playerid, str);
    return 1;
}
Reply
#8

well it work thanks anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)