Doubled Value
#1

I've got:
Код:
new playersvehcolorid[MAX_PLAYERS];
But how we know, vehicle could have two colors. Is there anyway to keep two colors in one table?
Reply
#2

You have to use one variable for each color. In this case, two.

Edit: You may use like this:
pawn Код:
new playersvehcolorid[MAX_PLAYERS][2];

playersvehcolorid[playerid][0] = 2;// Color one
playersvehcolorid[playerid][1] = 6;// Color two
Reply
#3

OK, have another little question don't have to create new topic.

This is setting:
Код:
playersvehmodelid[playerid] = modelid;
And this is getting:
Код:
modelid = playersvehmodelid[playerid];
Right?
Reply
#4

Yes, if playersvehmodelid[playerid] is global.
PHP код:
#include <a_samp>
new playersvehmodelid[MAX_PLAYERS];
public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    new 
modelid=GetVehicleModel(vehicleid);
    
playersvehmodelid[playerid]=modelid;//This is SETting playersvehmodelid[playerid] to modelid.
    //playersvehmodelid[playerid] is changed to modelid.
    //blablabla
    
return 1;
}
CMD:getvmod(playeridparams[])
{
    new 
modelid playersvehmodelid[playerid]; //This is GETting information FROM playersvehmodelid[playerid] to modelid
    //playersvehmodelid[playerid] is not changed.
    //blablabla
    
return 1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)