SA-MP Forums Archive
2 Questions, Keys & Pay nґ Spray - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 2 Questions, Keys & Pay nґ Spray (/showthread.php?tid=189700)



2 Questions, Keys & Pay nґ Spray - Psycho77 - 12.11.2010

Hey,

I have 2 big problems.

1.: when my engine is off, you should cannot drive. easy: SetVehicleVelocity(vehicleid,0.0,0.0,z);
but the velocity should set when he want to drive, so: when the keys are: w or s.
newkeys & KEY_UP || newkeys & KEY_DOWN.
But when the Keys are pressed nothing happened.
I already look at samp wiki but i cant define it.

2.: i want to turn the Pay nґSpray off. when he drive in, his car will be repair. but this shouldnґt happen!
where i should write it. I try it under OnVehicleRespray and OnVehiclePaintJob, but it doesnґt work!

this are 2 big problems which must be solved.


Re: 2 Questions, Keys & Pay nґ Spray - The_Moddler - 12.11.2010

Quote:
Originally Posted by Psycho77
Посмотреть сообщение
Hey,

I have 2 big problems.

1.: when my engine is off, you should cannot drive. easy: SetVehicleVelocity(vehicleid,0.0,0.0,z);
but the velocity should set when he want to drive, so: when the keys are: w or s.
newkeys & KEY_UP || newkeys & KEY_DOWN.
But when the Keys are pressed nothing happened.
I already look at samp wiki but i cant define it.

2.: i want to turn the Pay nґSpray off. when he drive in, his car will be repair. but this shouldnґt happen!
where i should write it. I try it under OnVehicleRespray and OnVehiclePaintJob, but it doesnґt work!

this are 2 big problems which must be solved.
1. KEY_UP it isn't.. just make a GetPlayerKeys under OnPlayerUpdate, check the vehicle HP, and if is less than 500.0, by getting the player keys, you set the car velocity.

Quote from Wiki:

pawn Код:
public OnPlayerUpdate(playerid)
{
    new Keys,ud,lr;
    GetPlayerKeys(playerid,Keys,ud,lr);
 
    if(ud > 0) SendClientMessage(playerid, 0xFFFFFFFF, "DOWN");
    else if(ud < 0) SendClientMessage(playerid, 0xFFFFFFFF, "UP");
 
    if(lr > 0) SendClientMessage(playerid, 0xFFFFFFFF, "RIGHT");
    else if(lr < 0) SendClientMessage(playerid, 0xFFFFFFFF, "LEFT");
 
    return 1;
}
2. Just put some fences outside the Pay 'N' Spray, so people can't go in.


Re: 2 Questions, Keys & Pay nґ Spray - GaGlets(R) - 12.11.2010

1. Just freeze player when he enters vehicle.
2. Unable function, i think. Jus put object int that pay&spray or just put gates in entrance of it.

i hope it would be able to shut the pay and spray as MTA can. ;S

Edit: soz writed on quick reply.


Re: 2 Questions, Keys & Pay nґ Spray - Psycho77 - 12.11.2010

hm pay n spray should be open.
i try it with OnPlayerUpdate