2 Questions, Keys & Pay nґ Spray
#1

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.
Reply
#2

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.
Reply
#3

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.
Reply
#4

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


Forum Jump:


Users browsing this thread: 2 Guest(s)