Problem for remove player from train - 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)
+--- Thread: Problem for remove player from train (
/showthread.php?tid=308765)
Problem for remove player from train -
Dima_Tkach - 05.01.2012
I have problem.
Code:
PHP код:
if(newstate == PLAYER_STATE_PASSENGER)
{
if(GetVehicleModel(newcar) == 538 || 570)
{
if(PlayerInfo[playerid][pTicketTrain] == 1)
{
PlayerInfo[playerid][pTicketTrain]--;
return 1;
}
else
{
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
What is wrong?
Re: Problem for remove player from train -
Norck - 05.01.2012
Check this out:
pawn Код:
if(newstate == PLAYER_STATE_PASSENGER)
{
new model == GetVehicleModel(newcar);
if(model == 538 || model == 570)
{
if(PlayerInfo[playerid][pTicketTrain] == 1)
{
PlayerInfo[playerid][pTicketTrain]--;
return 1;
}
else
{
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
Re: Problem for remove player from train -
Dima_Tkach - 05.01.2012
It did not help.
Re: Problem for remove player from train -
Norck - 05.01.2012
And what are you want this code to do? Explain your problem.
Re: Problem for remove player from train -
Dima_Tkach - 05.01.2012
When a player pTrainTicket = 0 then it must be discarded from the vehicle 538 and 570, but does not throw ...
Re: Problem for remove player from train -
Norck - 05.01.2012
Try this:
pawn Код:
if(newstate == PLAYER_STATE_PASSENGER)
{
new model == GetVehicleModel(GetPlayerVehicleID(playerid));
if(model == 538 || model == 570)
{
if(PlayerInfo[playerid][pTicketTrain] > 0)
{
PlayerInfo[playerid][pTicketTrain]--;
return 1;
}
else
{
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
Re: Problem for remove player from train -
Dima_Tkach - 05.01.2012
Not work
Re: Problem for remove player from train -
Norck - 05.01.2012
Do you have any errors when you trying to compilie it?
Re: Problem for remove player from train -
Dima_Tkach - 05.01.2012
I have errors,but I fix them.
PHP код:
new model == GetVehicleModel(GetPlayerVehicleID(playerid));
PHP код:
new model = GetVehicleModel(GetPlayerVehicleID(playerid));
Re: Problem for remove player from train -
Norck - 05.01.2012
Oh, my bad. So does it works now?