SA-MP Forums Archive
Admin car - 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 car (/showthread.php?tid=291333)



Admin car - viosteaua98 - 19.10.2011

I want huntley just for admins how can i do?
If is admin can drive it if no eject


Re: Admin car - aRoach - 19.10.2011

All huntleys ?


Re: Admin car - viosteaua98 - 19.10.2011

Yes all huntleys


Re: Admin car - AeroBlast - 19.10.2011

pawn Код:
OnPlayerStateChange(playerid,oldstate,newstate)
{
    if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == 579) //Checking if the player is the driver of a Huntley
    {
        if(!IsPlayerAdmin(playerid)) //Checking if the player isn't an Admin ((Change it with your own variable))
        {
            RemovePlayerFromVehicle(playerid); //Removing the player from the vehicle
            SendClientMessage(playerid,0xFF0000FF,"Admins only!");
        }
    }
    return 1;
}



Re: Admin car - Pharrel - 19.10.2011

pawn Код:
//public onplayerstatechange
if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 579 && !IsPlayerAdmin(playerid))
    RemovePlayerFromVehicle(playerid);



Re: Admin car - nilanjay - 19.10.2011

https://sampforum.blast.hk/showthread.php?tid=288770

Check this tutorial


Re: Admin car - aRoach - 19.10.2011

Quote:
Originally Posted by AeroBlast
Посмотреть сообщение
pawn Код:
OnPlayerStateChange(playerid,oldstate,newstate)
{
    if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == 579) //Checking if the player is the driver of a Huntley
    {
        if(!IsPlayerAdmin(playerid)) //Checking if the player isn't an Admin ((Change it with your own variable))
        {
            RemovePlayerFromVehicle(playerid); //Removing the player from the vehicle
            SendClientMessage(playerid,0xFF0000FF,"Admins only!");
        }
    }
    return 1;
}
Are you ... not vehicle id, MODELID, dude...

pawn Код:
OnPlayerStateChange(playerid,oldstate,newstate)
{
    if(newstate == PLAYER_STATE_DRIVER && GetVehicleModelID(GetPlayerVehicleID(playerid)) == 579) //Checking if the player is the driver of a Huntley
    {
        if(!IsPlayerAdmin(playerid)) //Checking if the player isn't an Admin ((Change it with your own variable))
        {
            RemovePlayerFromVehicle(playerid); //Removing the player from the vehicle
            SendClientMessage(playerid,0xFF0000FF,"Admins only!");
            }
        }
    return 1;
}



Re: Admin car - viosteaua98 - 19.10.2011

All huntleys only for admins this what i want
pawn Код:
D:\Jocuri\Gta san andreas\Admin.pwn(98) : error 017: undefined symbol "GetVehicleModelID"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && GetVehicleModelID(GetPlayerVehicleID(playerid)) == 579) //Checking if the player is the driver of a Huntley;
    {
         if(!IsPlayerAdmin(playerid)) //Checking if the player isn't an Admin ((Change it with your own variable))
         {
             RemovePlayerFromVehicle(playerid); //Removing the player from the vehicle
             SendClientMessage(playerid,0xFF0000FF,"Admins only!");
         }
    }
    return 1;
}



Re: Admin car - viosteaua98 - 19.10.2011

error...


Re: Admin car - grand.Theft.Otto - 19.10.2011

Quote:
Originally Posted by viosteaua98
Посмотреть сообщение
All huntleys only for admins this what i want
pawn Код:
D:\Jocuri\Gta san andreas\Admin.pwn(98) : error 017: undefined symbol "GetVehicleModelID"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Its:

GetVehicleModel(GetPlayerVehicleID(playerid));