08.09.2009, 20:50
thank you for helping me but it doesnt work... when i go into a Faggio nothing happen...
this is my code :
this is my code :
Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(IsPlayerInVehicle(playerid, 462))
{
if(newstate == 2)//checks if player entered as driver
{
if(GetPlayerMoney(playerid) >= 25) //25 = the money u want the car to cost.
{
GivePlayerMoney(playerid,-25);
SendClientMessage(playerid,0xFFFF00AA,"You just bought this car.");
}
else
SendClientMessage(playerid,0xFFFF00AA,"You don't have enought money for this car.");
RemovePlayerFromVehicle(playerid);
}
else
SendClientMessage(playerid,0xFFFF00AA,"You need to enter as driver to buy this car."); //change YOUR_COLOR to the colors you have got and that you want to use
RemovePlayerFromVehicle(playerid);
}
}

