SA-MP Forums Archive
help! - 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: help! (/showthread.php?tid=514270)



help! - Kells - 20.05.2014

can someone Tell Me how to Make a Vehicle Only For Vips If player Goes To that Vehicle It says : 'You Need Vip to use this car '
here my vip info :
Код:
if(PlayerInfo[playerid][pVIP] >= 1)
help please


Re: help! - Spartaaaaa - 20.05.2014

EDIT: You have already fs or u want us to make vehicle fs


Re: help! - [..MonTaNa..] - 20.05.2014

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        //Place your vehicle variable here
        {
            if(PlayerInfo[playerid][pVIP] >= 1)
            {
                SendClientMessage(playerid, -1, "This vehicle is only available for VIP players.");
                RemovePlayerFromVehicle(playerid);
            }
     }
}



Re: help! - Kells - 20.05.2014

Quote:
Originally Posted by [..MonTaNa..]
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        //Place your vehicle variable here
        {
            if(PlayerInfo[playerid][pVIP] >= 1)
            {
                SendClientMessage(playerid, -1, "This vehicle is only available for VIP players.");
                RemovePlayerFromVehicle(playerid);
            }
     }
}
i put in vehicle Variable place like this :
Код:
AddStaticVehicle(411,-1482.2827,411.8228,29.8131,267.5269,86,6); //
?


Re: help! - JFF - 20.05.2014

pawn Код:
new vipcar:
Ongamemodeinit
pawn Код:
vipcar = AddStaticVehicle(411,-1482.2827,411.8228,29.8131,267.5269,86,6); //
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER)
    {
            if(PlayerInfo[playerid][pVIP] < 1 && GetPlayerVehicleID(playerid) == vipcar)
            {
                SendClientMessage(playerid, -1, "This vehicle is only available for VIP players.");
                RemovePlayerFromVehicle(playerid);
            }
     }
}



Re: help! - Kells - 20.05.2014

thats not working . help


Re: help! - MacT - 20.05.2014

Then try this one:
pawn Код:
new vipcar:

Ongamemodeinit
vipcar = AddStaticVehicle(411,-1482.2827,411.8228,29.8131,267.5269,86,6); //

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER)
    {
            if(PlayerInfo[playerid][pVIP] == 0 && GetPlayerVehicleID(playerid) == vipcar)
            {
                SendClientMessage(playerid, -1, "This vehicle is only available for VIP players.");
                RemovePlayerFromVehicle(playerid);
            }
     }
}



Re: help! - [..MonTaNa..] - 20.05.2014

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(vipcar[vehicleid] && PlayerInfo[playerid][pVIP] == 0)
        {
            SendClientMessage(playerid, -1, "This vehicle is only available for VIP players.");
            RemovePlayerFromVehicle(playerid);
        }
     }
}
Give this a try