Just a little question. - 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: Just a little question. (
/showthread.php?tid=587467)
Just a little question. -
JessThompson - 31.08.2015
Say I had a enum like this
Код:
enum examplename
{
string[50],
stringClass,
}
new test[][exmaplename] =
{
{"Name1", 1},
{"name2", 2},
{"Name3", 1},
{"name4", 2},
}
How would I grab the first 1 and then when I click a textdraw arrow it goes to the seconed 1?
Re: Just a little question. -
SickAttack - 31.08.2015
new var;
...
test[++ var][stringClass]
Re: Just a little question. -
JessThompson - 31.08.2015
Sorry I don't understand that?
Re: Just a little question. -
Sellize - 31.08.2015
Just pointing this out... lol
Код:
enum examplename
{
string[50],
stringClass,
}
new test[][exmaplename] =
{
{"Name1", 1},
{"name2", 2},
{"Name3", 1},
{"name4", 2},
}
Re: Just a little question. -
JessThompson - 31.08.2015
Yeah its just a example but anyone willing to help. I would like to know how to make a stock or something that will select the first car.
Код:
if(listitem == 0) // Bikes
{
for (new i; i < sizeof(DScarBuy); i++)
{
if (DScarBuy[i][DSVehicleClass] == 9)
{
new FirstCar[10];
format(FirstCar, sizeof(FirstCar), "%i", DScarBuy[0][DSCarModel]);
new spawnedcar = AddStaticVehicleEx(strval(FirstCar), 488.0754, -420.3091, 2757.9961, 358.6074, 1, 1, 3600);
PutPlayerInVehicle(playerid, spawnedcar, 0);
TogglePlayerControllable(playerid,0);
if(prc_Moving[playerid] == false) // Check whether the camera is already set.
{
prc_Degree[playerid] = 0; // Reseting the variable
prc_Timer[playerid] = SetTimerEx("MoveCamera", 75, true, "d", playerid); // Setting the timer
prc_Moving[playerid] = true; // okay, now we're going to activate the moving variable
}
}
}
}
I have done that so far but that is grabbing the first car in the whole list I would like to make it so it only grabs the first car with the class of 9