Is this nessesary?
#1

Quote:

forward RemoveDriverFromVehicle(playerid);
public RemoveDriverFromVehicle(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
return 0;
}

if (newkeys & KEY_SECONDARY_ATTACK)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
RemoveDriverFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1; //<--------- is this nessesary ?
}
}

"the return 1; above?
Reply
#2

Well as long as you don't want to have strange bugs, then yes.
Reply
#3

pawn Код:
if (newkeys & KEY_SECONDARY_ATTACK)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        RemovePlayerFromVehicle(playerid);
        TogglePlayerControllable(playerid, 1);
    }
}
return 1 is not exactly needed there, and why are you doing the same thing 2 times?

if u want more code in key_secondary attack, then return 1 might be needed
Reply
#4

So do i remove return 1; or doesn't it matter
Reply
#5

Why not just
pawn Код:
OnPlayerEnterVehicle(playerid, vehicleid)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        RemovePlayerFromVehicle(playerid);
    }
    // other stuff
    return 1;
}
Reply
#6

KEY_SECONDARY_ATTACK is exiting a vehicle, and onplayerentervehicle is actually called when a player attempts to enter a vehicle

just put the code i gave you

why are u even using that code? that code is already gta-sided... are u trying to make as soon as u click enter it puts u out of the vehicle?
Reply
#7

yes to exit
Reply
#8

just click enter.. its gta hard coded already-.-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)