PDA

View Full Version : Scripting question [Rep +1]


MichaelProPlayer
03/04/2012, 03:55 PM
Hello,I need help.I want to make a script like this one:

if player using COLOR_YELLOW and if he is in a car (SFPD Police car ID:597) then he will automatically get out of the car.

Can anyone help??? I know its a very easy question and I am a noob so sorry for adding a useless thread.....Anyway Please help:(:(

MichaelProPlayer
03/04/2012, 04:00 PM
Can anybody please???

Yordan_Kronos
03/04/2012, 04:04 PM
First You cant give +Rep
Second you need from factions vehicles :)

blank.
03/04/2012, 04:04 PM
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerColor(playerid) == COLOR_YELLOW && GetVehicleModel(GetPlayerVehicleID(playerid)) == 597)
{
RemovePlayerFromVehicle(playerid);
}

}
}

sjvt
03/04/2012, 04:05 PM
DELETED, blank was first

MichaelProPlayer
03/04/2012, 04:08 PM
No teams its just if any player using COLOR_YELLOW then he can't drive that car....:(

sjvt
03/04/2012, 04:10 PM
No teams its just if any player using COLOR_YELLOW then he can't drive that car....:(

Look blank code..

MichaelProPlayer
03/04/2012, 04:13 PM
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerColor(playerid) == COLOR_YELLOW && GetVehicleModel(GetPlayerVehicleID(playerid)) == 597)
{
RemovePlayerFromVehicle(playerid);
}

}
}
Sorry but i am getting 1 error.Can please someone help me....Please

blank.
03/04/2012, 04:15 PM
Do you have the color yellow defined?
If not; #define COLOR_YELLOW 0xFFFF00FF
Put that on top of your code.

MichaelProPlayer
03/04/2012, 04:28 PM
thanks all of you its finally working :D :D :D :D