SA-MP Forums Archive
Job help - 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: Job help (/showthread.php?tid=654072)



Job help - Astonish - 20.05.2018

Hello i am using this script https://sampforum.blast.hk/showthread.php?tid=604693 but the script uses createvehicle and when those vehicle ingame wont work so what i want to do is check if player is in car id 448 which is pizza bike so the job start and i did that but the problem arise when i do /getpizza i cant get it because the script find the scripted vehicle how to do that if is player in range of car 448 he can do /getpizza


Re: Job help - DarkSkull - 20.05.2018

I won't advise you to do that. Because that will mess up the script, as it will interfere with the way that the script works. Unless You wan't to re-script the thing, I may have a solution. And that is to just add your Pizza bikes inside the FS.

To add a pizza bike, Follow these steps.

PHP код:
new pizzabikes[x]; 
Change the number 'x' to the amount of pizza bikes you are going to add.

Next, You would add a pizza bike like so:

PHP код:
pizzabikes[x] = CreateVehicle(448,2094.0500,-1821.4058,12.9817,90.0841,3,6,60000,0); // Pizzaboy 
Remember, You have to specify each vehicles coords. Click here for CreateVehicle syntax.

Now comes a part which you can deal with in two ways. Static and Dynamic. You have to change the limit of the loops. You do that by changing all the for loops that look like this:

PHP код:
for(new j=0;j<5;j++) 
to this:

PHP код:
for(new j=0;j<x;j++) 
where x is the number you mentioned earlier.

The other way is to do:

PHP код:
for(new j=0;j<sizeof(pizzabikes);j++) 
This automatically get the array size and you don't have to keep on changing this. The second way is much better.

NOTE: I have not tested this code. This is to make you understand different approach to solve your problems. There might be other places in the script where the script creator uses 5 vehicles. You have to learn to adapt and improvise.



Re: Job help - Astonish - 31.05.2018

the FS do creates pizza bike but when i use it with my script the fuel is always 0 and the bike doesn't startup when i press 2 but other vehicle does


Re: Job help - GTLS - 31.05.2018

Thats because the variables you use for your fuel, is not setup on your FilterScript. Use PVars to pass information around different scripts.

SetPVarInt - to set value
GetPVarInt - to get value

(int only, but there are different functions for different datatypes. Search on wiki for more info)


Re: Job help - Astonish - 31.05.2018

Cant i make the script to determine 448 as a pizza car ?


Re: Job help - Astonish - 02.06.2018

help?