if player in vehicle scripts
#1

Well, i want script that it would say like:
Код:
public OnPlayerInVehicle(playerid)    // this doesnt exist in pawno
{
  if(IsPlayerInVehicle(playerid, 150))
  SetTimer("fltdrunktimer",3000,true);  // this does set players drunk level at 4000 every third second
} 
return 1;
}
And i have no idea how to make that one, where should i put:
Код:
   if(IsPlayerInVehicle(playerid, 150))
  SetTimer("fltdrunktimer",3000,true);
Reply
#2

You want to start the timer when he enters a vehicle, and stop the timer when he exits it?
Reply
#3

seriously, you realy think i will read what you wrote, if you have signature like that... xD ill try... :P
back to topic:
uhm, kinda, ok or lets say, how to make, that if you are in vehicle id 150, every 3 second it will automaticly set drunk level to 4000?
Reply
#4

Use OnPlayerStateChange (public OnPlayerStateChange(playerid, newstate, oldstate). I wanted to create something similair to that, he told me to use OnPlayerStateChange and it worked fine.

Script:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(vehicleid)==150)
{
SetTimer("fltdrunktimer",3000,true);
}
return 1;
}
Reply
#5

Just for info: Vehicle IDs are from 400 => 611, which means that ID 150 does not exist.
But the code of Biesem seems to be good, you have just to change the 150 to an existing ModelID.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)