06.02.2011, 11:06
how to make the cars not to be drivable without payment ? like when someone gets into a car it will ask him to pay for it..if he doesn't accept the character will automatically get out of the car
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
ShowPlayerDialog(playerid, dialogid, style, "something here", "Accept" , "Decline");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case 1:
{
case 0:
{
if(GetPlayerMoney(playerid) > 500)
{
SendClientMessage(playerid, COLOR, "You Dont Have Enough Money");
RemovePlayerFromVehicle(playerid);
}
else if(GetPlayerMoney(playerid) < 500)
{
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, COLOR, "You Have Rented This Vehicle");
}
}
}
}
return 1;
}