one command question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: one command question (
/showthread.php?tid=161113)
one command question -
admine - 18.07.2010
Who can explain me how I put in a script?
A car that only has to pay the toll before he could drive!
Re: one command question -
bartje01 - 18.07.2010
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;
}
Re: one command question -
Kar - 18.07.2010
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;
}
Re: one command question -
bartje01 - 18.07.2010
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.
Re: one command question -
admine - 18.07.2010
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
Re: one command question -
Kar - 18.07.2010
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
Re: one command question -
bartje01 - 18.07.2010
make a moving gate that closes on a timer. and kar. I understand you :P
Re: one command question -
Kar - 18.07.2010
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
Re: one command question -
admine - 18.07.2010
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
Re: one command question -
bartje01 - 18.07.2010
Well still. Use a gate. When you do /paytoll. the gate will open if you have enough money. like in real life.