SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/09/2011, 04:23 PM   #1
Salsa
Huge Clucker
 
Salsa's Avatar
 
Join Date: Apr 2011
Location: Tokoyo, Japan
Posts: 438
Reputation: 13
Default Vip Car Help

i need help with VIP car i save a car at a place now i want it for only vips how when any player trying to take vip car A Message show on player screen YOU NEED TO BE VIP LEVEL 2 TO TAKE THIS CAR

Code:
AddStaticVehicle(561,2170.4277,1973.5856,10.6340,88.5622,1,255); //
__________________
Hosted Tab For 13$ Per Month : DISABLE NOW
Mapping For $ Pm Me If You Want Maps
Need Registered IRC Channel Pm Me I Can Make Irc Channel's On Request
Salsa is offline   Reply With Quote
Old 29/09/2011, 04:28 PM   #2
iPLEOMAX
High-roller
 
iPLEOMAX's Avatar
 
Join Date: Mar 2011
Location: AE
Posts: 1,250
Reputation: 746
Default Re: Vip Car Help

pawn Code:
//Global - On top of script
new VIP_CAR1;

//GameModeInit
VIP_CAR1 = AddStaticVehicle(561,2170.4277,1973.5856,10.6340,88.5622,1,255);

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == VIP_CAR1)
{
if(pInfo[playerid][VIPLevel] < 2)
{
SendClientMessage(playerid, 0xFF0000FF, "You need to be VIP Member (Level 2) to use this vehicle.");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}

Untested.

Sorry for the bad indentation, can't be bothered about that right now.
__________________
Goodbye SA-MP.
iPLEOMAX is offline   Reply With Quote
Old 29/09/2011, 04:44 PM   #3
Salsa
Huge Clucker
 
Salsa's Avatar
 
Join Date: Apr 2011
Location: Tokoyo, Japan
Posts: 438
Reputation: 13
Default Re: Vip Car Help

actually i am using 0Admin so plz edit it for 0Admin can i put it on 0Admin

Example of one 0Admin command
==>
Code:
CMD:cargod(PARAMS)
{
    LoginCheck(playerid);
    LevelCheck(playerid, 1);

	switch(P_DATA[playerid][CarGod])
	{
	    case false:
	    {
	        P_DATA[playerid][CarGod] = 1;
			SetPVarInt(playerid, "0_CarGod", 1);
	        SendClientMessage(playerid, Color:GREY, "Vehicle God has been activated!");
		}
		case true:
		{
		    P_DATA[playerid][CarGod] = 0;
		    SetPVarInt(playerid, "0_CarGod", 0);
	        SendClientMessage(playerid, Color:GREY, "Vehicle God has been deactivated!");

		}
	}
	return 1;
}
__________________
Hosted Tab For 13$ Per Month : DISABLE NOW
Mapping For $ Pm Me If You Want Maps
Need Registered IRC Channel Pm Me I Can Make Irc Channel's On Request
Salsa is offline   Reply With Quote
Old 29/09/2011, 04:51 PM   #4
Kingunit
High-roller
 
Kingunit's Avatar
 
Join Date: Dec 2010
Location: The Netherlands
Posts: 1,426
Reputation: 120
Default Re: Vip Car Help

pawn Code:
//Global - On top of script
new VIP_CAR1;

//GameModeInit
VIP_CAR1 = AddStaticVehicle(561,2170.4277,1973.5856,10.6340,88.5622,1,255);

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == VIP_CAR1)
    {
        if(pInfo[playerid][VIPLevel] < 2)
        {
            SendClientMessage(playerid, 0xFF0000FF, "You need to be VIP Member (Level 2) to use this vehicle.");
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}

// Code from iPLEOMAX
__________________
Kingunit is offline   Reply With Quote
Old 14/05/2012, 06:40 AM   #5
Amine_Mejrhirrou
Gangsta
 
Amine_Mejrhirrou's Avatar
 
Join Date: Dec 2010
Location: RAbat
Posts: 555
Reputation: 6
Default Re : Vip Car Help

is it posible to do something like
Code:
new vipcars;


///////////////
	vipcars = CreateVehicle(415, 2541.9836, 2373.1616, 4.2078, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(494, 2542.0288, 2369.3257, 4.2078, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(601, 2525.2507, 2364.4233, 4.2071, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(601, 2525.2004, 2368.7664, 4.2071, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(601, 2525.7378, 2372.9229, 4.2071, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(601, 2525.3804, 2376.8618, 4.2071, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(601, 2525.5127, 2381.3167, 4.2071, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(568, 2515.0525, 2363.9822, 4.5085, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(495, 2516.2449, 2382.1934, 4.5085, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(444, 2516.2219, 2377.1284, 4.5085, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(557, 2515.5313, 2372.4619, 4.5085, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(424, 2514.8418, 2368.2844, 4.5085, 90.0000, -1, -1, 10000);
	vipcars = CreateVehicle(447, 2494.1953, 2398.8889, 71.5000, 0.0000, -1, -1, 10000);
	vipcars = CreateVehicle(488, 2494.1772, 2387.4556, 71.5327, 0.0000, -1, -1, 10000);
	vipcars = CreateVehicle(476, 2477.7434, 2355.8086, 71.5000, 0.0000, -1, -1, 10000);
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == VIP_CAR1)
    {
        if(pInfo[playerid][VIPLevel] < 2)
        {
            SendClientMessage(playerid, 0xFF0000FF, "You need to be VIP Member (Level 2) to use this vehicle.");
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
just to avoid to put vipcar1 vipcar2 vipcar3 ...
Amine_Mejrhirrou is offline   Reply With Quote
Old 14/05/2012, 07:23 AM   #6
Ballu Miaa
High-roller
 
Ballu Miaa's Avatar
 
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,849
Reputation: 323
Default Re: Vip Car Help

You can do this
pawn Code:
new vipcars[14];

// Under OnGameModeInIt

vipcars = CreateVehicle(415, 2541.9836, 2373.1616, 4.2078, 90.0000, -1, -1, 10000);
    vipcars[0] = CreateVehicle(494, 2542.0288, 2369.3257, 4.2078, 90.0000, -1, -1, 10000);
    vipcars[1] = CreateVehicle(601, 2525.2507, 2364.4233, 4.2071, 90.0000, -1, -1, 10000);
    vipcars[2] = CreateVehicle(601, 2525.2004, 2368.7664, 4.2071, 90.0000, -1, -1, 10000);
    vipcars[3] = CreateVehicle(601, 2525.7378, 2372.9229, 4.2071, 90.0000, -1, -1, 10000);
    vipcars[4] = CreateVehicle(601, 2525.3804, 2376.8618, 4.2071, 90.0000, -1, -1, 10000);
    vipcars[5] = CreateVehicle(601, 2525.5127, 2381.3167, 4.2071, 90.0000, -1, -1, 10000);
    vipcars[6] = CreateVehicle(568, 2515.0525, 2363.9822, 4.5085, 90.0000, -1, -1, 10000);
    vipcars[7] = CreateVehicle(495, 2516.2449, 2382.1934, 4.5085, 90.0000, -1, -1, 10000);
    vipcars[8] = CreateVehicle(444, 2516.2219, 2377.1284, 4.5085, 90.0000, -1, -1, 10000);
    vipcars[9] = CreateVehicle(557, 2515.5313, 2372.4619, 4.5085, 90.0000, -1, -1, 10000);
    vipcars[10] = CreateVehicle(424, 2514.8418, 2368.2844, 4.5085, 90.0000, -1, -1, 10000);
    vipcars[11] = CreateVehicle(447, 2494.1953, 2398.8889, 71.5000, 0.0000, -1, -1, 10000);
    vipcars[12] = CreateVehicle(488, 2494.1772, 2387.4556, 71.5327, 0.0000, -1, -1, 10000);
    vipcars[13] = CreateVehicle(476, 2477.7434, 2355.8086, 71.5000, 0.0000, -1, -1, 10000);
__________________


I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 14/05/2012, 09:12 AM   #7
Amine_Mejrhirrou
Gangsta
 
Amine_Mejrhirrou's Avatar
 
Join Date: Dec 2010
Location: RAbat
Posts: 555
Reputation: 6
Default Re : Vip Car Help

ok thank you (it's simpler liker that)
and for OnPlayerStateChange ir will be
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == vipcars)
++rep by the way
Amine_Mejrhirrou is offline   Reply With Quote
Old 14/05/2012, 10:39 AM   #8
Ballu Miaa
High-roller
 
Ballu Miaa's Avatar
 
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,849
Reputation: 323
Default Re: Re : Vip Car Help

Quote:
Originally Posted by Amine_Mejrhirrou View Post
ok thank you (it's simpler liker that)
and for OnPlayerStateChange ir will be
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == vipcars)
++rep by the way
Haha Thanks for the 100th Rep Point.
__________________


I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 14/05/2012, 05:30 PM   #9
Amine_Mejrhirrou
Gangsta
 
Amine_Mejrhirrou's Avatar
 
Join Date: Dec 2010
Location: RAbat
Posts: 555
Reputation: 6
Default Re : Vip Car Help

not working when i do that
Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == vipcars[]) {
		new file[128];
		format(file, sizeof(file), USER_FILE, GetPName(playerid));
		if(dini_Int(file, "VIP")< 1){
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid,YELLOW,"Not Vip");
		}
    }
    return 1;
}
Amine_Mejrhirrou is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 04:06 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.