17.02.2010, 14:55
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:
And inside the OnPlayerDisconnect callback i used this:
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 ...
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) } } }
Код:
if(Info[playerid][eCarKeys] != 0) { for(new i; i < MAX_PLAYERS; i++) { if(i != playerid) { SetVehicleParamsForPlayer(Info[playerid][eCarKeys], i, 0, 0) } } }
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 ...