IsPlayerInVehicle problem.
#9

Actually, a Switch/Case works better in your case...
You can define the vehicles you want to do something to so much easier...
Here's a little example I wrote for you to examine...
Just spawn yourself in different type of vehicles and you'll see how it works when you type /INVEH
Once you "get" the coding you can adapt it to your particular needs...

(Put in OnPlayerCommandText)

if(strcmp(cmd,"/INVEH",true)==0){
if(IsPlayerInAnyVehicle(playerid)){
new vehtype[16];
switch(GetVehicleModel(GetPlayerVehicleID(playerid ))){
case 441,464,465,501,564,594:{vehtype="RC Vehicle";}
case 430,446,452 .. 454,472,473,484,493,595:{vehtype="Boat";}
case 461,463,468,521 .. 523,581,586:{vehtype="MotorCycle";}
default:{vehtype="who cares?";}
}// end of switch
format(msv0,sizeof(msv0),"You are in a %s",vehtype);
SendClientMessage(playerid,0xFFFFFFAA,msv0);
}// end of IsPlayerInAnyVehicle
return 1;}

Cheers
8^}>
Reply


Messages In This Thread
IsPlayerInVehicle problem. - by Shetch - 27.02.2011, 14:49
Re: IsPlayerInVehicle problem. - by Master_Gangster - 27.02.2011, 15:16
Re: IsPlayerInVehicle problem. - by admantis - 27.02.2011, 15:18
Re: IsPlayerInVehicle problem. - by Shetch - 27.02.2011, 15:28
Re: IsPlayerInVehicle problem. - by Shetch - 27.02.2011, 15:52
Re: IsPlayerInVehicle problem. - by Master_Gangster - 27.02.2011, 16:30
Re: IsPlayerInVehicle problem. - by Mean - 27.02.2011, 17:15
Re: IsPlayerInVehicle problem. - by Shetch - 27.02.2011, 22:01
Re: IsPlayerInVehicle problem. - by Spectre - 28.02.2011, 03:01
Re: IsPlayerInVehicle problem. - by Shetch - 07.03.2011, 07:24

Forum Jump:


Users browsing this thread: 3 Guest(s)