Help a bit here +rep -
N0FeaR - 10.03.2012
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.");
Re: Help a bit here +rep -
Basicz - 10.03.2012
I guess this is the problem :
pawn Код:
if(IsATaxicar)) // one opening bracket and 2 closing brackets. wtf.
//Should be
if ( IsATaxicar( GetPlayerVehicleID( playerid ) ) )
Re: Help a bit here +rep -
N0FeaR - 10.03.2012
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 ?
Re: Help a bit here +rep -
Baboon - 10.03.2012
I guess you are checking with istaxicar whether it is the right vehiclemodel, try this:
if ( IsATaxicar( GetVehicleModel( GetPlayerVehicleID( playerid ) ) ) )
Re: Help a bit here +rep -
N0FeaR - 10.03.2012
I use this callback
pawn Код:
}
public IsATaxicar(carid)
{
new model = GetVehicleModel(carid);
if(model == 420)
{
return 1;
}
return 0;
}
Re: Help a bit here +rep -
Basicz - 10.03.2012
pawn Код:
if ( IsATaxicar( GetPlayerVehicleID( playerid ) ) )
{
if( PlayerInfo[ playerid ][ pJob ] != 2 )
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this car.");
}
}
Re: Help a bit here +rep -
N0FeaR - 10.03.2012
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.
Re: Help a bit here +rep -
eesh - 11.03.2012
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.");
}
}
}
Re: Help a bit here +rep -
Andi_Evandy - 11.03.2012
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.");
}
}
}
Re: Help a bit here +rep -
N0FeaR - 11.03.2012
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?