how to make this
#1

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

here ill give your a basic idea
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
              ShowPlayerDialog(playerid, dialogid, style, "something here", "Accept" , "Decline");
        }
        return 1;
}
now you got to have response to the dialog you just made
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;
}
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
Reply
#3

Why are you using a switch statement for that, it works fine without switch and is faster to, And why using a dialog? you can also just send him a message that he rented the vehicle, and if not remove him. No dialog needed
Reply
#4

so he could confirm if he wanted to rent the vehicle
Reply
#5

Quote:
Originally Posted by fangoth1
Посмотреть сообщение
so he could confirm if he wanted to rent the vehicle
I don't think if he typed it in a command it would be an accident.
Reply
#6

he wants it to pop something up when the enter the vehicle thus this will work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)