VIP Cars help.
#1

I dont have a code much atm thats why i need help

All i have is

Quote:

new VipPlane1;
new VipPlane2;
new VipPlane3;
new VipPlane4;
new VipPlane5;

Then i have

Quote:

public OnGamodeInit()
{
VipCar1 = AddStaticVehicle(593,1297.6238,1252.8761,11.2798,4 .2079,1,1); // plane
VipCar2 = AddStaticVehicle(593,1340.5513,1255.7225,11.2792,1 .6959,1,1); // plane
VipCar3 = AddStaticVehicle(593,1344.6190,1237.3309,11.2797,2 70.6658,1,1); // plane
VipCar4 = AddStaticVehicle(593,1332.2885,1233.9496,11.2777,1 81.6530,1,1); // plane
VipCar5 = AddStaticVehicle(593,1295.3361,1236.9692,11.2841,8 8.7790,1,1); // plane

But i dont know how to finish it.

So Only VIPS can get in the planes.

I use
Quote:

#include <ladmin>

So if anyone you know how i can make the vehicles just so vips can enter i would appritiate it


Thanks!
Reply
#2

Don't Matter what Admin system you use

Use this
pawn Код:
new VipCar1[MAX_PLAYERS];
new VipCar2[MAX_PLAYERS];
new VipCar3[MAX_PLAYERS];
new VipCar4[MAX_PLAYERS];
new VipCar5[MAX_PLAYERS];
new VIP[MAX_PLAYERS];

public OnGameModeInit()
{
                                                  // Car
    VipCar1[playerid] = AddStaticVehicle(593,1297.6238,1252.8761,11.2798,4 .2079,1,1);
                                                  // Car
    VipCar2[playerid] = AddStaticVehicle(593,1340.5513,1255.7225,11.2792,1 .6959,1,1);
                                                  // Car
    VipCar3[playerid] = AddStaticVehicle(593,1344.6190,1237.3309,11.2797,2 70.6658,1,1);
                                                  // Car
    VipCar4[playerid] = AddStaticVehicle(593,1332.2885,1233.9496,11.2777,1 81.6530,1,1);
                                                  // Car
    VipCar5[playerid] = AddStaticVehicle(593,1295.3361,1236.9692,11.2841,8 8.7790,1,1);
    return 1;
}


if(strcmp(cmdtext, "/makemevip", true)==0)
{
    VIP[playerid] == 1;
    SendClientMessage(playerid,COLOR,"Your an vip now :D");
    return 1;
}


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == VipCar1[playerid] || vehicleid == VipCar2[playerid] || vehicleid == VipCar3[playerid] vehicleid == VipCar4 [playerid] vehicleid == VipCar5[playerid]) {
        if(VIP[playerid] == 1) {
            SendClientMessage(playerid,COLOR,"YOUR AN VIP YAYAYAYA");
        }
        else if(VIP[playerid] == 0) {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid,COLOR,"Not Vip");
        }
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Kitten
Посмотреть сообщение
Don't Matter what Admin system you use

Use this
pawn Код:
//bunch of cod


Did you even try compiling it? Because I know it won't. Using MAX_PLAYERS to assign a single vehicleid? What the hell?

pawn Код:
new gVipCars[5];

//GameModeInit
gVipCars[0] = AddStaticVehicle(...);
gVipCars[1] = AddStaticVehicle(...);
gVipCars[2] = AddStaticVehicle(...);
gVipCars[3] = AddStaticVehicle(...);
gVipCars[4] = AddStaticVehicle(...);

//PlayerStateChange
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(/* put your variable to check for vip here */ == 0)
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            for(new i; i < sizeof(gVipCars); i++)
            {
                if(vehicleid == gVipCars[i])
                {
                    SendClientMessage(playerid, COLOR_RED, "Not Vip");
                    RemovePlayerFromVehicle(playerid);
                    break;
                }
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)