Car lock when owner is online
#1

Hello, I have a car ownership system inside my gamemode, and i tried to make the next thing.
Everytime a player connects, check if he has a car bought. If yes, lock the car automatically to all the players except him.
Everytime a player disconnects, check if he has a car bought. If yes, unlock the car automatically to all the players.
I used SetVehicleParamsForPlayer at the end of OnPlayerLogin callback (I'm using the register and login system from Godfather with some edits for my own gamemode) like this:
Код:
if(Info[playerid][eCarKeys] != 0)
{
	for(new i; i < MAX_PLAYERS; i++)
	{
	  if(i != playerid)
	  {
  		SetVehicleParamsForPlayer(Info[playerid][eCarKeys], i, 0, 1)
	  }
	}
}
And inside the OnPlayerDisconnect callback i used this:
Код:
if(Info[playerid][eCarKeys] != 0)
{
	for(new i; i < MAX_PLAYERS; i++)
	{
	  if(i != playerid)
	  {
  		SetVehicleParamsForPlayer(Info[playerid][eCarKeys], i, 0, 0)
	  }
	}
}
But, nothing happens. I mean, is not locking my car automatically after I login, and not unlocking my car after logout.
I tried with OnVehicleStreamIn too, but if I login and i'm not near the car, is not locking, and after disconnect if the car is locked, it remain locked.
I tried with Timers too, still nothing.
What else can I try or what i'm doing wrong, I don't have any more ideeas.

LE: Title changed ...
Reply


Messages In This Thread
Car lock when owner is online - by chosen - 17.02.2010, 14:55
Re: Automatic car lock on login - by chosen - 18.02.2010, 07:40
Re: Automatic car lock when owner is online - by chosen - 19.02.2010, 06:47
Re: Automatic car lock when owner is online - by chosen - 21.02.2010, 07:08
Re: Car lock when owner is online - by chosen - 22.02.2010, 06:49
Re: Car lock when owner is online - by Onyx09 - 22.02.2010, 07:17

Forum Jump:


Users browsing this thread: 1 Guest(s)