Problem for remove player from train
#1

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

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;
               }
        }
    }
Reply
#3

It did not help.
Reply
#4

And what are you want this code to do? Explain your problem.
Reply
#5

When a player pTrainTicket = 0 then it must be discarded from the vehicle 538 and 570, but does not throw ...
Reply
#6

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;
               }
        }
    }
Reply
#7

Not work
Reply
#8

Do you have any errors when you trying to compilie it?
Reply
#9

I have errors,but I fix them.

PHP код:
new model == GetVehicleModel(GetPlayerVehicleID(playerid)); 
PHP код:
new model GetVehicleModel(GetPlayerVehicleID(playerid)); 
Reply
#10

Oh, my bad. So does it works now?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)