4 errors in one line ,need help
#1

i get this ,when im trying to make a command for army stats....

pawn Код:
C:\Users\Hacker\Desktop\my script\gamemodes\test.pwn(1359) : error 012: invalid function call, not a valid address
C:\Users\Hacker\Desktop\my script\gamemodes\test.pwn(1359) : warning 215: expression has no effect
C:\Users\Hacker\Desktop\my script\gamemodes\test.pwn(1359) : error 001: expected token: ";", but found ")"
C:\Users\Hacker\Desktop\my script\gamemodes\test.pwn(1359) : error 029: invalid expression, assumed zero
C:\Users\Hacker\Desktop\my script\gamemodes\test.pwn(1359) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
here is the command .....

pawn Код:
cmd(army, playerid, params[])
{
    if(pInfo[playerid][Adminlevel] >= 5)
    {
        new string[200], pName[MAX_PLAYER_NAME];
        if(sscanf(params, "u", playerid))
            return SendClientMessage(playerid, COLOR_RED, "Usage: /army (player <id>)");
        if(!IsPlayerConnected(playerid))
            return SendClientMessage(playerid, COLOR_RED, "Usage: /army (player <id>)");
        if(GetPVarInt(playerid, "ArmyPermission") == 1337)
            return SendClientMessage(playerid, COLOR_RED, "That player already have army stats!! .");
        format(string, 120, "[ARMY NEWS] Server Admin %s has made %s a member of the Army!", pInfo(playerid), pInfo([playerid))
        SendClientMessageToAll(COLOR_PURPLE, string);
        SendAdminMessage(string);
        CNR_PrintString(string);
        SendClientMessage(playerid, COLOR_PURPLE, "You are now able to play as Los Santos Army. Be sure to stick with rules or your army stats will be taken.");
        SetPVarInt(playerid, "ArmyPermission", 1337);
    }
    return 1;
}
Reply
#2

Which line shows error?
Reply
#3

pawn Код:
format(string, 120, "[ARMY NEWS] Server Admin %s has made %s a member of the Army!", pInfo(playerid), pInfo([playerid))
Where's the semicolon?
Reply
#4

Your whole command wouldn't work, there was mistake that you were using your variable to get player name, missing one colon at line, and you were setting the army thing for yourself. Re-made the command.

pawn Код:
cmd(army, playerid, params[])
{
    if(pInfo[playerid][Adminlevel] >= 5)
        return SendClientMessage(playerid, -1, "Not Authorized.");
       
    new string[128], giveplayerid, giveplayer[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
   
    if(sscanf(params, "u", giveplayerid))
        return SendClientMessage(playerid, COLOR_RED, "Usage: /army (player <id>)");
       
        if(giveplayerid == INVALID_PLAYER_ID)
        return SendClientMessage(playerid, COLOR_RED, "Usage: /army (player <id>)");
       
    if(GetPVarInt(playerid, "ArmyPermission") == 1337)
        return SendClientMessage(playerid, COLOR_RED, "That player already have army stats!! .");
       
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));   
   
    format(string, sizeof(str), "[ARMY NEWS] Server Admin %s has made %s a member of the Army!", PlayerName, giveplayer);
    SendClientMessageToAll(COLOR_PURPLE, string);
    SendAdminMessage(string);
    CNR_PrintString(string);
   
    SendClientMessage(giveplayerid, COLOR_PURPLE, "You are now able to play as Los Santos Army. Be sure to stick with rules or your army stats will be taken.");
    SetPVarInt(giveplayerid, "ArmyPermission", 1337);
    return true;
}
Reply
#5

i have other errors -_-

pawn Код:
C:\Users\arjan\Desktop\my script\gamemodes\CNR.pwn(1353) : error 001: expected token: "-identifier-", but found "["
C:\Users\arjan\Desktop\my script\gamemodes\CNR.pwn(1358) : warning 217: loose indentation
C:\Users\arjan\Desktop\my script\gamemodes\CNR.pwn(1361) : warning 217: loose indentation
C:\Users\arjan\Desktop\my script\gamemodes\CNR.pwn(1364) : error 029: invalid expression, assumed zero
C:\Users\arjan\Desktop\my script\gamemodes\CNR.pwn(1364) : error 035: argument type mismatch (argument 2)
C:\Users\arjan\Desktop\my script\gamemodes\CNR.pwn(1364) : error 020: invalid symbol name ""
C:\Users\arjan\Desktop\my script\gamemodes\CNR.pwn(1364) : fatal error 107: too many error messages on one line

error 1
pawn Код:
new string[128], giveplayerid, giveplayer[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
error 2
pawn Код:
if(giveplayerid == INVALID_PLAYER_ID)
error 3
pawn Код:
if(GetPVarInt(playerid, "ArmyPermission") == 1337)
error 4+5+6+7
pawn Код:
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
Reply
#6

well thank you for trying to help me but never mind i will just remove the cmd
if i want to make someone army i will make it at scriptfiles
Reply
#7

pawn Код:
cmd(army, playerid, params[])
{
    if( pInfo[ playerid ][ Adminlevel ] >= 5 )
        return SendClientMessage( playerid, -1, "Not Authorized." );

    new
        giveplayerid;

    if( sscanf( params, "u", giveplayerid ) || giveplayerid == INVALID_PLAYER_ID )
        return SendClientMessage( playerid, COLOR_RED, "Usage: /army (player <id>)" );

    if( GetPVarInt( giveplayerid, "ArmyPermission" ) == 1337 )
        return SendClientMessage( playerid, COLOR_RED, "That player already have army stats!! ." );

    new
        PlayerName[ MAX_PLAYER_NAME char ],
        giveplayer[ MAX_PLAYER_NAME char ];

    GetPlayerName( playerid, PlayerName, sizeof PlayerName );
    GetPlayerName( giveplayerid, giveplayer, sizeof giveplayer );    

    new string[ 128 char ];
    format( string, sizeof string, "[ARMY NEWS] Server Admin %s has made %s a member of the Army!", PlayerName, giveplayer);

    SendClientMessageToAll( COLOR_PURPLE, string );
    SendAdminMessage( string );
    CNR_PrintString( string );
   
    SendClientMessage( giveplayerid, COLOR_PURPLE, "You are now able to play as Los Santos Army. Be sure to stick with rules or your army stats will be taken." );

    return
        SetPVarInt( giveplayerid, "ArmyPermission", 1337 );

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)