SA-MP Forums Archive
Doubled Value - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Doubled Value (/showthread.php?tid=547432)



Doubled Value - cnoopers - 22.11.2014

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?


Re: Doubled Value - Larceny - 22.11.2014

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



Re: Doubled Value - cnoopers - 22.11.2014

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?


Re: Doubled Value - Mic_H - 22.11.2014

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;