Will this work?
#1

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

You probably meant:

pawn Код:
if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(playerid2))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)