Will this work? - 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: Will this work? (
/showthread.php?tid=148485)
Will this work? -
Assyria - 17.05.2010
Hey.
I am first time trying to use Pvars, and Im not sure about playerid2 thing, that will it work.
Does this line work?:
if(GetPlayerVehicleID(playerid) == 411,GetPlayerVehicleID(playerid2) == 411)
Here is the untested part of code:
Код:
forward Fare(playerid);
public Fare(playerid)
{
new playerid2;
if(InTaxi[playerid] != 1) return true;
{
new string[128];
SetPVarInt(playerid2, "FareAmmount", GetPVarInt(playerid, "FareAmmount"));
format(string,sizeof(string),"~w~-~r~$%i",GetPVarInt(playerid, "FareAmmount"));
GivePlayerMoney(playerid, - GetPVarInt(playerid, "FareAmmount"));
GameTextForPlayer(playerid,string,3000,1);
}
if(IsAsTaxiDriver[playerid] != 1) return true;
{
if(GetDistanceBetweenPlayers(playerid,playerid2) < 5)
{
if(GetPlayerVehicleID(playerid) == 411,GetPlayerVehicleID(playerid2) == 411)
{
new string[128];
SetPVarInt(playerid2, "FareAmmount", GetPVarInt(playerid, "FareAmmount"));
format(string,sizeof(string),"~w~+~r~$%i",GetPVarInt(playerid, "FareAmmount"));
GivePlayerMoney(playerid, GetPVarInt(playerid,"FareAmmount"));
GameTextForPlayer(playerid,string,3000,1);
}
}
}
return 1;
}
Im pretty sure that everything is not right there, if you can see what is wrong, tell me how I should do it.
(Compiles without errors...)
Since I haven't scripted very long, I don't have knownledge for how all things work so...
Regards,
Assyria
Re: Will this work? -
¤Adas¤ - 17.05.2010
You probably meant:
pawn Код:
if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(playerid2))