How to make vehicles for vips?
#4

Quote:
Originally Posted by knackworst
Посмотреть сообщение
First of all u need a variable to make a player a vip:
Код:
new VIP[MAX_PLAYERS];
add this on top of your FS/GM
under the defines

then add this under OnPlayerCommandText:
Код:
if (strcmp("/makemevip", cmdtext, true, 10) == 0)
	{
	    SendClientMessage(playerid, COLOR_SEXYGREEN, "You are now VIP!");
		VIP[playerid] == 1;
		return 1;
	}
NOTE the example is not advanced, u can always make urself vip even if u are already one... but that's not the intention for this example...

Then under OnPlayerStateCHange
add this:
Код:
if(newstate == 2)
    {
        if(VIP[playerid] == 1)
        {
            new vehicle;
    		vehicle = GetVehicleModel(GetPlayerVehicleID(playerid));
			if(vehicle == 300 || vehicle == 400 || vehicle == 500) //change the numbers to the car ID u want the vip to be able to enter
			{
			    SendClientMessage(playerid, COLOR_SEXYGREEN, "U entered a VIP vehicle");
			}
		}
		else if(VIP[playerid] == 0)
		{
		    RemovePlayerFromVehicle(playerid);
		    SendClientMessage(playerid, COLOR_RED, "U need to be a VIP for this vehicle!");
		}
	}
so ur script should look a lil like this:
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#define COLOR_RED 0xFF0000AA
#define COLOR_SEXYGREEN 0x00FF00FF

new VIP[MAX_PLAYERS];

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/makemevip", cmdtext, true, 10) == 0)
	{
	    SendClientMessage(playerid, COLOR_SEXYGREEN, "You are now VIP!");
		VIP[playerid] = 1;
		return 1;
	}
	return 0;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        if(VIP[playerid] == 1)
        {
            new vehicle;
    		vehicle = GetVehicleModel(GetPlayerVehicleID(playerid));
			if(vehicle == 300 || vehicle == 400 || vehicle == 500) //change the numbers to the car ID u want the vip to be able to enter
			{
			    SendClientMessage(playerid, COLOR_SEXYGREEN, "U entered a VIP vehicle");
			}
		}
		else if(VIP[playerid] == 0)
		{
		    RemovePlayerFromVehicle(playerid);
		    SendClientMessage(playerid, COLOR_RED, "U need to be a VIP for this vehicle!");
		}
	}
	return 1;
}
I already have a command to /makevip, but if i add "if(vehicle == 300 || vehicle == 400 || vehicle == 500)" and there is a vehicle id 300 at the gym for non vips player can't enter it also?
Reply


Messages In This Thread
How to make vehicles for vips? - by maikel saliba - 28.08.2011, 22:41
Re: How to make vehicles for vips? - by knackworst - 28.08.2011, 22:50
Re: How to make vehicles for vips? - by qUick1337 - 28.08.2011, 22:50
Re: How to make vehicles for vips? - by maikel saliba - 28.08.2011, 23:16
Re: How to make vehicles for vips? - by knackworst - 29.08.2011, 00:30
Re: How to make vehicles for vips? - by maikel saliba - 29.08.2011, 00:33
Re: How to make vehicles for vips? - by Davz*|*Criss - 29.08.2011, 01:01
Re: How to make vehicles for vips? - by knackworst - 29.08.2011, 01:08

Forum Jump:


Users browsing this thread: 3 Guest(s)