Pawno 2 Errors??
#1

C:\Users\Ro\Desktop\xef-origenale\Gamemodes\xef.pwn(3976) : error 033: array must be indexed (variable "vehlist")
C:\Users\Ro\Desktop\xef-origenale\Gamemodes\xef.pwn(14956) : error 035: argument type mismatch (argument 2)


public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == vehlist)// line 3976
{
if(response)
{
ACTIONS
}
else SendClientMessage(playerid, 0xFF0000FF, "Cancelled vehicle selection");
return 1;
}
return 1;
}

CMD:veh(playerid, params[])
{
ShowModelSelectionMenu(playerid, vehlist, "Vehicles - Click To Spawn");// line 14k (second error)
}

I am using mSelection but i dont want to use the .txt file so i made this in the gamemode

new vehlist[300] = {
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36 ,37,38,39,40,.....299
};


How can i fix it? Thanks to all
Reply
#2

PHP код:
public OnPlayerModelSelection(playeridresponselistidmodelid)
{
    for(new 
i;i<sizeof vehlist;i++)
    {
        if(
listid == vehlist[i])
        {
            if(
response)
            {
                
//Actions
            
}
            else 
SendClientMessage(playerid,0xFF0000FF,"Cancelled vehicle selection");
        }
        break;
    }
    return 
1;

and
PHP код:
CMD:veh(playerid,params[])
{
    for(new 
i;i<sizeof vehlist;i++)
    {
        
ShowModelSelectionMenu(playerid,vehlist[i],"Vehicles - Click to Spawn");
    }
    return 
1;

Reply
#3

No need an array to do that.

PHP код:
public OnPlayerModelSelection(playeridresponselistidmodelid)
{
    if(!
response) return SendClientMessage(playerid0xFF0000FF"Cancelled vehicle selection");
    
ACTION
    
    
return 1;
}
CMD:veh(playeridparams[])
{
    for(new 
0300i++)
        
ShowModelSelectionMenu(playeridi"Vehicles - Click To Spawn");
    
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)