admin vehicle
#1

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
   if(
pData[playerid][pAdmin] < 1)
   {
     if(
vehicleid == 601)
     {
        
ClearAnimations(playerid);
        
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
     }
   }
   return 
1;

What's wrong with it? idk its not working players can enter this car
Reply
#2

You should use this code under OnPlayerStateChange
PHP код:

public OnPlayerEnterVehicle(playeridvehicleidispassenger

   if(
pData[playerid][pAdmin] < 1
   { 
     if(
vehicleid == 601
     { 
        
ClearAnimations(playerid); 
        
GameTextForPlayer(playerid,"Admin Vehicle",3000,4); 
     } 
   } 
   return 
1

Like this
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)

    if( 
newstate == PLAYER_STATE_DRIVER && GetVehicleModelGetPlayerVehicleIDplayerid )) == 601 && pData[playerid][pAdmin] < 1)
    {
                
RemovePlayerFromVehicleplayerid );
                
GameTextForPlayerplayerid"~r~~h~Admin Vehicle.!"3000);
    }
   return 
1

Reply
#3

^^^^^^^^
Reply
#4

I don't want player get in vehicle seat. Anyone else?
Reply
#5

Hmm... I think that's not working CUZ there are only 600 cars in San Andreas ?
Reply
#6

You can't use the vehicleid, you need to keep track of which vehicle spawns as the admin vehicle EVERY time it spawns.
Reply
#7

Quote:
Originally Posted by Sithis
Посмотреть сообщение
You can't use the vehicleid, you need to keep track of which vehicle spawns as the admin vehicle EVERY time it spawns.
Use Arrays for admin cars and also use this when player enters an admin car

new Float:PlayerPos[ 3 ];
GetPlayerPos(playerid, PlayerPos[ 0 ], PlayerPos[ 1 ], PlayerPos[ 2 ]);
SetPlayerPos(playerid, PlayerPos[ 0 ], PlayerPos[ 1 ], PlayerPos[ 2 ]);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)