Help About VIP CARS !
#1

How to make a VIP CARS SYSTEM that for only for donators ? [pDonator] ?

i will give you +rep if u help me

Please teach me too where i will put it ?

example

#define MAX_VIPCARS 10 //put it under include

PLEASE PLEASE
Reply
#2

pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == vehicleidfordonors) // Change 'vehicleidfordonors' to your vehicle id.
    {
        if(!PlayerInfo[playerid][pDonator]) // Check if the player is not a donor.
        {
            return 0; // Not letting him get into the car.
        }
    }
    return 1;
}
Reply
#3

I think put "You're not a donator" if he enter the car and where is max VIPCARS ? and x,y,z ?
Reply
#4

You need to add your own vehicles under OnGameModeInit and you need to add the donors' vehicles with ids.
Then you do what I did but with adding a message.
Reply
#5

I'll just add on to the code above

pawn Code:
//Under ongamemodeinit
new vehicleidfordonors = CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60); //example car from wiki, you'll have to change it

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == vehicleidfordonors) // Change 'vehicleidfordonors' to your vehicle id.
    {
        if(PlayerInfo[playerid][pDonator]) // Check if the player is not a donor.
        {
            SendClientMessage(playerid, -1, "You've got in a VIP car!"); // -1 Is white color
        }
    }
    else SendClientMessage(playerid, -1, "You're not vip silly.."); //The message the player will get if they're no vip
    return 1;
}
Reply
#6

Actually, the code you posted still lets him get into the car. You need to return false.
Reply
#7

Quote:
Originally Posted by Stinged
View Post
Actually, the code you posted still lets him get into the car. You need to return false.
True, I was going to let him use something like

pawn Code:
RemovePlayerFromVehicle(playerid);
Although return false would be more appropriate in stopping the player entering the vehicle at all.
Reply
#8

@Flake can u give the whole code like what you do in my recent thread? in VIP LOCKER ?
Reply
#9

This code works
pawn Code:
//Under ongamemodeinit
new vehicleidfordonors = CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60); //example car from wiki, you'll have to change it

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == vehicleidfordonors) // Change 'vehicleidfordonors' to your vehicle id.
    {
        if(PlayerInfo[playerid][pDonator]) // Check if the player is not a donor.
        {
            SendClientMessage(playerid, -1, "You've got in a VIP car!"); // -1 Is white color
        }
    }
    else SendClientMessage(playerid, -1, "You're not vip silly.."); //The message the player will get if they're no vip
    return 1;
}
But the problem is if he is not VIP he can enter vip car ? how do i eject him ?

i tried

pawn Code:
{
    if(vehicleid == 451) // Change 'vehicleidfordonors' to your vehicle id.
    {
        if(PlayerInfo[playerid][pDonator] > 0) // Check if the player is not a donor.
        {
            SendClientMessage(playerid, -1, "You've got in a VIP car!"); // -1 Is white color
           
        }
    }
    else SendClientMessage(playerid, -1, "You're not vip silly.."); //The message the player will get if they're no vip
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
But he's still can enter ? how can i eject him ? and in what Flake said return it false what code i will use ?
Reply
#10

I tried to put it on
OnPlayerStateChange

but i got this error

pawn Code:
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(41226) : warning 217: loose indentation
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(41218) : warning 204: symbol is assigned a value that is never used: "vehicleidfordonors"
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46747) : warning 217: loose indentation
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46766) : warning 217: loose indentation
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46950) : warning 217: loose indentation
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46971) : error 017: undefined symbol "vehicleid"
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46984) : warning 225: unreachable code
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46984) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
The errror is
pawn Code:
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46971) : error 017: undefined symbol "vehicleid"
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)