Help a bit here +rep
#1

Error i get

Код:
C:\Users\Robins\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerStateChange.pwn(76) : error 076: syntax error in the expression, or invalid function call
C:\Users\Robins\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerStateChange.pwn(76) : error 029: invalid expression, assumed zero
pawn code
pawn Код:
}
    else if(newstate == PLAYER_STATE_DRIVER)
    {
       GetPlayerVehicleID(playerid);
    }
    if(IsATaxicar))
    {
        if(PlayerInfo[playerid][pJob] == 2)
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
Reply
#2

I guess this is the problem :
pawn Код:
if(IsATaxicar)) // one opening bracket and 2 closing brackets. wtf.
//Should be
if ( IsATaxicar( GetPlayerVehicleID( playerid ) ) )
Reply
#3

Quote:
Originally Posted by Basicz
Посмотреть сообщение
I guess this is the problem :
pawn Код:
if(IsATaxicar)) // one opening bracket and 2 closing brackets. wtf.
//Should be
if ( IsATaxicar( GetPlayerVehicleID( playerid ) ) )
Fixed get no erros but when i enter a taxi i can still drive it want so player get remove from the vehicle you know how to fix that ?
Reply
#4

I guess you are checking with istaxicar whether it is the right vehiclemodel, try this:

if ( IsATaxicar( GetVehicleModel( GetPlayerVehicleID( playerid ) ) ) )
Reply
#5

I use this callback

pawn Код:
}
public IsATaxicar(carid)
{
    new model = GetVehicleModel(carid);
    if(model == 420)
    {
        return 1;
    }
    return 0;
}
Reply
#6

pawn Код:
if ( IsATaxicar( GetPlayerVehicleID( playerid ) ) )
{
    if( PlayerInfo[ playerid ][ pJob ] != 2 )
    {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
    }
}
Reply
#7

Quote:
Originally Posted by Basicz
Посмотреть сообщение
pawn Код:
if ( IsATaxicar( GetPlayerVehicleID( playerid ) ) )
{
    if( PlayerInfo[ playerid ][ pJob ] != 2 )
    {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
    }
}
Shit i can still taxi cars when im not taxi driver this strange.
Reply
#8

pawn Код:
public IsATaxicar(carid)
{
    new model = GetVehicleModel(carid);
    if(model == 420 || model == 438)
    {
        return 1;
    }
    return 0;
}
There are 2 models of Taxis. You might be entering the other type.

Also check if the taxi job is 2. It could be some other ID?

pawn Код:
else if(newstate == PLAYER_STATE_DRIVER)
    {
       if ( IsATaxicar( GetPlayerVehicleID( playerid ) ) )
        {
            if( PlayerInfo[ playerid ][ pJob ] != 2 )
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
            }
        }
    }
Reply
#9

pawn Код:
else if(newstate == PLAYER_STATE_DRIVER)
    {
       if ( IsATaxicar( GetVehicleModel( GetPlayerVehicleID( playerid ) ) ) ) //if Vehicle model that player enter is taxi
        {
            if( PlayerInfo[ playerid ][ pJob ] != 2 ) //if Player job is not "2" or "taxi driver (maybe)"
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
            }
        }
    }
Reply
#10

Quote:
Originally Posted by Andi_Evandy
Посмотреть сообщение
pawn Код:
else if(newstate == PLAYER_STATE_DRIVER)
    {
       if ( IsATaxicar( GetVehicleModel( GetPlayerVehicleID( playerid ) ) ) ) //if Vehicle model that player enter is taxi
        {
            if( PlayerInfo[ playerid ][ pJob ] != 2 ) //if Player job is not "2" or "taxi driver (maybe)"
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
            }
        }
    }
I add this but still when you are not taxi driver i can drive the taxi whats can be the problem?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)