SA-MP Forums Archive
admin vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: admin vehicle (/showthread.php?tid=581526)



admin vehicle - ALoX12 - 13.07.2015

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


Re: admin vehicle - MBilal - 13.07.2015

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




Re: admin vehicle - STONEGOLD - 13.07.2015

^^^^^^^^


Re: admin vehicle - ALoX12 - 13.07.2015

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


Re: admin vehicle - SpikeSpigel - 13.07.2015

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


Re: admin vehicle - Sithis - 13.07.2015

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


Re: admin vehicle - Sime30 - 13.07.2015

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 ]);