How to lock car?
#1

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

Use
PHP код:
SetVehicleParamsForPlayer(vehicleid,playerid,objective,doorslocked
. Objective put 0 and doorslocked put 1.
Reply
#3

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

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?
Reply
#5

hmm.. what didn't work, the locking or unlocking?
Reply
#6

Quote:
Originally Posted by dowster
Посмотреть сообщение
hmm.. what didn't work, the locking or unlocking?
both the car didnt lock to begin with |:
Reply
#7

hmm.. when is the car created? in OnGameModeInit?
Reply
#8

Quote:
Originally Posted by dowster
Посмотреть сообщение
hmm.. when is the car created? in OnGameModeInit?
YES
4CHAR
Reply
#9

try moving the locking code to the OnPlayerSpawn?
Reply
#10

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);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)