OnPlayerClickPlayer, +REP.
#1

Hey guys, I've tried to do when player clicks another player dialog will pop out, anyway I got the following error.

Quote:

C:\Documents and Settings\user\Desktop\Gamemode\Vane\gamemodes\vrp. pwn(31808) : error 029: invalid expression, assumed zero

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new string[64];
    new string2[128];
    new ranktext[32];
    (Line: 31808) - if(PlayerInfo[clickedplayerid][pHelper] == 1 &&  == 0){ ranktext = "Helper"; }
    if(PlayerInfo[clickedplayerid][pAdmin] == 2 &&  == 0){ ranktext = "Administrator"; }
    if(PlayerInfo[clickedplayerid][pAdmin] == 2 &&  == 0){ ranktext = "Administrator"; }
    if(PlayerInfo[clickedplayerid][pAdmin] == 3 &&  == 0){ ranktext = "Lead Administrators"; }
    if(PlayerInfo[clickedplayerid][pAdmin] == 6 &&  == 0){ ranktext = "Head Administrators"; }
    else { ranktext = "Civilian"; }
    if(clickedplayerid == playerid)
    {
        format(string, sizeof(string), "Player Info: %s", RPN);
        format(string2, sizeof(string2), "Name: %s\nRank: %s\nLevel: %d\n Paycheck Time(60): %d", RPN(clickedplayerid),ranktext,PlayerInfo[clickedplayerid][pLevel], PlayerInfo[clickedplayerid][pMinutes]);
        ShowPlayerDialog(playerid, 99, DIALOG_STYLE_MSGBOX, string, string2, "Ok","");
    } else {
        format(string, sizeof(string), "Player Info: %s", RPN);
        format(string2, sizeof(string2), "Name: %s\nRank: %s\nLevel: %d", RPN(clickedplayerid),ranktext,PlayerInfo[clickedplayerid][pLevel]);
        ShowPlayerDialog(playerid, 99, DIALOG_STYLE_MSGBOX, string, string2, "Ok","");
    }
    return 1;
}
Thats all the public, can you tell me please whats the problem?
Reply
#2

show line number : 31808
so i can help
Reply
#3

Use strval.

pawn Код:
if(PlayerInfo[clickedplayerid][pHelper] == 1 &&  == 0){ ranktext = strval("Helper"); }
Reply
#4

Also , why you used && == 0 that's mean if his admin rank equal to 0 , you need to change to '&& PlayerInfo[clickedplayer][Admin]!=0' which means not equal too. also its useless checking your variable will be check once the player is level 1 only.
Reply
#5

Quote:
Originally Posted by iZN
Посмотреть сообщение
Use strval.

pawn Код:
if(PlayerInfo[clickedplayerid][pHelper] == 1 &&  == 0){ ranktext = strval("Helper"); }
pawn Код:
C:\Documents and Settings\user\Desktop\Gamemode\Vane\gamemodes\vrp.pwn(31808) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\Gamemode\Vane\gamemodes\vrp.pwn(31808) : warning 215: expression has no effect
C:\Documents and Settings\user\Desktop\Gamemode\Vane\gamemodes\vrp.pwn(31808) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\user\Desktop\Gamemode\Vane\gamemodes\vrp.pwn(31808) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\Gamemode\Vane\gamemodes\vrp.pwn(31808) : fatal error 107: too many error messages on one line
31808 Line

pawn Код:
if(PlayerInfo[clickedplayerid][pHelper] == 1 &&  == 0){ ranktext = strval("Helper"); }
Reply
#6

Try changing to
pawn Код:
if(PlayerInfo[clickedplayerid][pHelper] == 1)
{
ranktext = "Helper";
}
Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
Also , why you used && == 0 that's mean if his admin rank equal to 0 , you need to change to '&& PlayerInfo[clickedplayer][Admin]!=0' which means not equal too. also its useless checking your variable will be check once the player is level 1 only.
Reply
#7

Must be a nightmare script to work with having that many lines in a single file anyways.

pawn Код:
if(PlayerInfo[clickedplayerid][pHelper] == 1){ ranktext = "Helper"; }
    else if(PlayerInfo[clickedplayerid][pAdmin] == 2){ ranktext = "Administrator"; }
    else if(PlayerInfo[clickedplayerid][pAdmin] == 2){ ranktext = "Administrator"; }
    else if(PlayerInfo[clickedplayerid][pAdmin] == 3){ ranktext = "Lead Administrators"; }
    else if(PlayerInfo[clickedplayerid][pAdmin] == 6){ ranktext = "Head Administrators"; }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)