Posts: 53
Threads: 4
Joined: Jun 2011
Hi everyone i'm having trouble with this, using the new 0.3c features I was wondering if anyone can help me lock a car for when a player is not in mission so if(InMission[playerid]==0) and they try to get on a car missioncar = AddStaticVehicle(415,1685.48720000,1751.96670000,1 0.59900000,268.11830000,25,1,2500); they wont be able to because the car will be locked thanks all :P
Posts: 53
Threads: 4
Joined: Jun 2011
Quote:
Originally Posted by dowster
try this out, should be ready to go
Код:
public OnPlayerConnect(playerid)
{
SetVehicleParamsForPlayer( missioncar, playerid, 0, 1);
return 1;
}
this way it will be locked for everyone, but in the beginning of the mission put:
Код:
SetVehicleParamsForPlayer(missioncar, playerid, 0, 0)
so to unlock it, and at the end of the mission just relock it again for that player
|
it didnt work any ideas?
Posts: 631
Threads: 58
Joined: Jun 2010
Reputation:
0
hmm.. what didn't work, the locking or unlocking?
Posts: 53
Threads: 4
Joined: Jun 2011
Quote:
Originally Posted by dowster
hmm.. what didn't work, the locking or unlocking?
|
both the car didnt lock to begin with |:
Posts: 631
Threads: 58
Joined: Jun 2010
Reputation:
0
hmm.. when is the car created? in OnGameModeInit?
Posts: 53
Threads: 4
Joined: Jun 2011
Quote:
Originally Posted by dowster
hmm.. when is the car created? in OnGameModeInit?
|
YES
4CHAR
Posts: 631
Threads: 58
Joined: Jun 2010
Reputation:
0
try moving the locking code to the OnPlayerSpawn?
Posts: 53
Threads: 4
Joined: Jun 2011
Quote:
Originally Posted by dowster
try moving the locking code to the OnPlayerSpawn?
|
moved nothing happened here ill show you what i have
Код:
new missioncar;
missioncar = AddStaticVehicle(474,-1996.68286133,1224.90783691,31.54843712,270.00000000,-1,-1);
Onplayerconnect
SetVehicleParamsForPlayer(missioncar,playerid,0,1);