06.02.2011, 11:34
here ill give your a basic idea
now you got to have response to the dialog you just made
There ya go, that should work, but if you get out of the vehicle you would more then likely have to rent it again, you would have to set a timer , and sorry for bad indent dont like forums cant hit tab
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
ShowPlayerDialog(playerid, dialogid, style, "something here", "Accept" , "Decline");
}
return 1;
}
pawn Код:
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;
}