one command question
#1

Who can explain me how I put in a script?

A car that only has to pay the toll before he could drive!
Reply
#2

Alright.
At onplayerentervehicle:
pawn Код:
if(GetVehicleModel(vehicleid) == 601) // change the ID to the car model
{
     if(ispassenger == 0)
    {
    ShowPlayerDialog(playerid,DIALOG_STYLE_MSGBOX,1,"Car","You need to pay 20$ to drive","Pay","Cancel");
}
}
and @ ondialogresponse
pawn Код:
if(dialogid == 1)
    {
        if(!response)
        {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid,COLOR_RED,"You left the car");
        }

        GivePlayerMoney(playerid,20);
        return 1;
    }
Reply
#3

i think he was thinking more of this

pawn Код:
if(dialogid == 1)
{
    if(!response)
    {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid,COLOR_RED,"You left the car");
        }
        else if(GetPlayerMoney(playerid) <= 20) return SendClientMessage(playerid,yourcolorhere,"You Don't Have Enough Money To Enter This Vehicle!");
        else
        {
        GivePlayerMoney(playerid,-20);
    }
    return 1;
}
Reply
#4

Just the same but you did that if you don't have 20$ you also can't do it. I just gave the basic. But thanks for updating it.
Reply
#5

Quote:
Originally Posted by Kar
Посмотреть сообщение
i think he was thinking more of this

pawn Код:
if(dialogid == 1)
{
    if(!response)
    {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid,COLOR_RED,"You left the car");
        }
        else if(GetPlayerMoney(playerid) <= 20) return SendClientMessage(playerid,yourcolorhere,"You Don't Have Enough Money To Enter This Vehicle!");
        else
        {
        GivePlayerMoney(playerid,-20);
    }
    return 1;
}
no sorry I mean the toll at the bridge you know san fiero bridge where you have to pay the toll to be over it now that I mean
Reply
#6

Quote:
Originally Posted by bartje01
Посмотреть сообщение
Just the same but you did that if you don't have 20$ you also can't do it. I just gave the basic. But thanks for updating it.
its k i just wanted to give him what he wanted<.< so he doesnt come back for mor eproblems


ONTOPIC: try using inplayerinrangeofpoint or something and then bring up that dialog
Reply
#7

make a moving gate that closes on a timer. and kar. I understand you :P
Reply
#8

why a gate? just use setworldbounds if player havent payed the player( not to sure this would WORK LOLOL)

butya a gate could be good if reponse = true or w/e moveobject etc

use the Search Button And Search for the gate tutorial
Reply
#9

yes bartje maar dat bedoel ik eigenlijk niet! ik bedoel als die in de tol plaats komt dat die dan 50 dollar moet betalen om door te kunen, heeft die het geld niet dan jammer dan kan je er niet door snapje!

sorry for my other language because bartje is execly dutch
Reply
#10

Well still. Use a gate. When you do /paytoll. the gate will open if you have enough money. like in real life.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)