Only Donator car.
#1

Hey guys i was looking for this information but i dint find anything, how can i make so all nrg 500 is only for donators? i dint mean then like

Код:
new donatorcar;

donatorcar = AddStatisticVehicle..
I want to make it on player state change but idk how? anyone who can?
Reply
#2

Put it under OnPlayerStateChange, if the new state is PLAYER_STATE_DRIVER and the vehicleid is donatorcar and the player is not a donator, use RemovePlayerFromVehicle(playerid); to remove him from the car.
Reply
#3

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
Put it under OnPlayerStateChange, if the new state is PLAYER_STATE_DRIVER and the vehicleid is donatorcar and the player is not a donator, use RemovePlayerFromVehicle(playerid); to remove him from the car.
Can u show me as a code please?
Reply
#4

Sry for bump but anyone who can help me?
Reply
#5

pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
    if( newstate == PLAYER_STATE_DRIVER )
    {
        if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 522 && !IsPlayerDonator( playerid ) )
        {
            RemovePlayerFromVehicle( playerid );
            SendClientMessage( playerid, -1, "Only donators can drive a nrg-500!" );
        }
    }
    return 1;
}
NOTE: Change !IsPlayerDonator(playerid) with your variable about checking whether they're donators or not.
Reply
#6

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
   if(newstate == PLAYER_STATE_DRIVER)
   {
       new vehicleid = GetPlayerVehicleID(playerid);
       if(DonatorsVehicle(vehicleid))
       {
          if(pInfo[playerid][donator] >= 1) return 1;
          else return RemovePlayerFromVehicle(playerid);
       }
    }
    return 1;
}
You need to have a script for it to see if the vehicle is for donators or not. a Function.
Reply
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
    if( newstate == PLAYER_STATE_DRIVER )
    {
        if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 522 && !IsPlayerDonator( playerid ) )
        {
            RemovePlayerFromVehicle( playerid );
            SendClientMessage( playerid, -1, "Only donators can drive a nrg-500!" );
        }
    }
    return 1;
}
NOTE: Change !IsPlayerDonator(playerid) with your variable about checking whether they're donators or not.
Hey thanks for you answer but i got this errors :
Код:
C:\Users\Dino\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(16431) : error 029: invalid expression, assumed zero
C:\Users\Dino\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(16431 -- 16433) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
And this is what i typed in:
Код:
  if( newstate == PLAYER_STATE_DRIVER )
    {
        if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 522 && if(PlayerInfo[playerid][pDonator] == 1))
        {
            RemovePlayerFromVehicle( playerid );
            SendClientMessage( playerid, COLOR_RED, "Only donators can drive a nrg-500!" );
        }
    }
The line problem is on If (getvehicle
Reply
#8

Change to:
pawn Код:
if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 522 && PlayerInfo[playerid][pDonator] != 1 )
You used an if inside the other. Plus the code after that is for removing the player that they're not donator.

Assuming PlayerInfo[playerid][pDonator] == 1 is donator, use != to check if they are not.
Reply
#9

I don't want to be too much of an ass but.... why are you wasting your time with Ravens Roleplay? It is one of the worst scripts on the forums.
Reply
#10

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Change to:
pawn Код:
if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 522 && PlayerInfo[playerid][pDonator] != 1 )
You used an if inside the other. Plus the code after that is for removing the player that they're not donator.

Assuming PlayerInfo[playerid][pDonator] == 1 is donator, use != to check if they are not.
Well it works fine if i had only one donator level but i have 3 donators levels ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)