RemovePlayerFromVehicle Doesn't Work ?
#21

Quote:
Originally Posted by Firez
Посмотреть сообщение
pawn Код:
#define RemovePlayerFromVehicle removePlayerFromVehicle

stock removePlayerFromVehicle ( playerid )
{
    if ( !IsPlayerInAnyVehicle(playerid) ) return 0;

    new vid = GetPlayerVehicleID(playerid);
    if ( vid == INVALID_VEHICLE_ID ) return 0;

    new Float: pos[4], Float: sideAngle;
    GetVehiclePos   ( vid, pos[0], pos[1], pos[2] );
    GetVehicleZAngle( vid, pos[3] );

    switch ( GetPlayerVehicleSeat(playerid) )
    {
        case 0,2 : sideAngle = pos[3] - 180.0;
        default  : sideAngle = pos[3];
    }

    SetPlayerPos( playerid,
        pos[0] + 2.0 * floatcos( sideAngle, degrees ),
        pos[1] + 2.0 * floatsin( sideAngle, degrees ),
        pos[2] + 0.3 );

    SetPlayerFacingAngle( playerid, pos[3] );

    SetCameraBehindPlayer(playerid);

    return 1;
}
fixes removeplayerfromvehicle bugs
Why all that if you can have RemovePlayerFromVehicle?

Also, the only bug that has it's that the other players can't see the animation of the player behing getting out of the car.
Reply
#22

Quote:
Originally Posted by Finn
Посмотреть сообщение
Are you sure this part is right:
pawn Код:
PlayerInfo[playerid][pJob] != 1
Also, I'd suggest first checking player's job, then launching the loop if the job is correct (not like you're doing - checking the job every loop tick). Plus breaking the loop when found the correct vehicle id wouldn't hurt.

pawn Код:
if(PlayerInfo[playerid][pJob] != 1)
{
    for(new i = 0; i <MAX_PIZZABIKES; i++)
    {
        if(vehicleid == PizzaJobVehicles[i])
        {
            SendClientMessage(playerid, COLOR_RED, "You don't have the keys of this Vehicle");
            SendClientMessage(playerid, COLOR_RED, "So you decide to step off the Pizzaboy");
           
            RemovePlayerFromVehicle(playerid);
            break; // Kill the loop.
        }
    }
}
Edit: Maybe I should learn to write faster.
Guys, can you explain, because i want to know, what actually means from this line:if(PlayerInfo[playerid][pJob] != 1):[pJob] and !=1?I only saw =1 per my scripting time...And i don't understand the whole line: for(new i = 0; i <MAX_PIZZABIKES; i++) :can someone say what it is used for?I understand that new i is variable and now it has integer 0 inside itself, but what it gives i don't know.Is this code i<MAX_PIZZABIKES only checks if all pizza boy bikes number is lower than variable i?So why it need than?And for me it's unclear how bikes number can be lower than variable i if variable is only 0, so there's no bikes? And the last thing about that is code i++ what actually it does?!Big thanks for the help and don't say anything like go and learn yourself boy.Write what you know about what i asking.
Reply
#23

i think it means i == 0 and i<MAX_PIZZABIKES; is checking if i is LESS then MAX_PIZZABIKES not the other way round and then adding 1 to i so for(new i = 0;i<MAX_PIZZABIKES;i++) is checking if there is less then the Pizzabikes variable then adding +1 to i
Reply
#24

My eyes tell me that you just bumped a 1 year old thread.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)