This shouldn't be happening?
#1

Код:
invalid expression, assumed zero
I get that error on the line:
pawn Код:
CMD:deployradio (playerid, params[])
{
    if(PRinfo[playerid][radioDeployed]==1) //PLayer already has 1 deployed
    {
        SendClientMessage(playerid, 0xFC00FCF, "You have already deployed an radio.");
    }
   
    for(new i=0;i<MAX_PLAYERS+1;i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, PRinfo[i][locX], PRinfo[i][locY], PRinfo[i][locZ]))//Cannont deploy if someone deployed already 1,near him
        {
            SendClientMessage(playerid, COLOR_GREY, "You can not place a radio near already existing one.Find another place");
        }
    }
   
    else // THIS LINE,but everything is fine?
    {
        ShowPlayerDialog(playerid, MUSIC_DIALOG, DIALOG_STYLE_LIST, "Choose a song", radioSongs, "OK", "");
    }

    return 1;
}
Reply
#2

pawn Код:
CMD:deployradio (playerid, params[])
{
    if(PRinfo[playerid][radioDeployed]==1) //PLayer already has 1 deployed
    {
        return SendClientMessage(playerid, 0xFC00FCF, "You have already deployed an radio.");
    }
    for(new i=0;i<MAX_PLAYERS+1;i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, PRinfo[i][locX], PRinfo[i][locY], PRinfo[i][locZ]))//Cannont deploy if someone deployed already 1,near him
        {
            SendClientMessage(playerid, COLOR_GREY, "You can not place a radio near already existing one.Find another place");
            return 1;
        }
    }
    ShowPlayerDialog(playerid, MUSIC_DIALOG, DIALOG_STYLE_LIST, "Choose a song", radioSongs, "OK", "");
    return 1;
}
You can't have an "else" statement under a "for".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)