Car Thing
#1

Hello, What i want today Is: that i have donator cars, Now, I have the function (IsPlayerDonator) or something like that xD it works, And i just wanted to know, how can i restrict a car to donators? I have searched and can't find anything, Thank you in advance :O
Reply
#2

it's this line here
pawn Код:
if(vid == DONOR[1] || if(IsPlayerVipMember(playerid));
You have 3 open ( and 2 closed )
Reply
#3

Quote:
Originally Posted by Hayden_Bruin
Посмотреть сообщение
it's this line here
pawn Код:
if(vid == DONOR[1] || if(IsPlayerVipMember(playerid));
You have 3 open ( and 2 closed )
God, I'm so dumb, XD What does that Mean? o.O
Reply
#4

every time u open a bracet ( u have to close it right

Soo when if(vid == DONOR[1] || if(IsPlayerVipMember(playerid));//<< that is correct
at the end of it there is two bracets they close off (playerid and if(vid
Reply
#5

Quote:
Originally Posted by jaydon
Посмотреть сообщение
every time u open a bracet ( u have to close it right
Yeah.. And it is closed.


Quote:

Soo when if(vid == DONOR[1] || if(IsPlayerVipMember(playerid));//<< that is correct
at the end of it there is two bracets they close off (playerid and if(vid

Yeah, so it shouldn't be coming up with errors?
Reply
#6

*BUMP..*
Reply
#7

pawn Код:
forward IsDonatorcar(vehicleid);
public IsDonatorCar(vehicleid)
{
    if(vehicleid >= *put there starting car id* && vehicleid <= *put there ending car id*)
    {
        return 1;
    }
    return 0;
}
under OnPlayerEnterVehicle
pawn Код:
if (IsDonatorCar(vehicleid) && !ispassenger))
    {
        if(IsPlayerDonator[playerid] != 1) // Change to your function
        {
            ApplyAnimation(playerid, "ped", "CAR_doorlocked_LHS", 3.0, 0, 0, 0, 0, 0);
            SetVehicleParamsForPlayer(vehicleid,playerid,0,1);
            new Float:cx, Float:cy, Float:cz;
            GetPlayerPos(playerid, cx, cy, cz);
            SetPlayerPos(playerid, cx,  cy, cz);
            SendClientMessage(playerid,COLOR_GREY,"Car is reserved for donators.");
            ApplyAnimation(playerid, "ped", "CAR_doorlocked_LHS", 3.0, 0, 0, 0, 0, 0);
        }
    }
Reply
#8

Quote:
Originally Posted by SaW_[VrTx]
Посмотреть сообщение
pawn Код:
forward IsDonatorcar(vehicleid);
public IsDonatorCar(vehicleid)
{
    if(vehicleid >= *put there starting car id* && vehicleid <= *put there ending car id*)
    {
        return 1;
    }
    return 0;
}
under OnPlayerEnterVehicle
pawn Код:
if (IsDonatorCar(vehicleid) && !ispassenger))
    {
        if(IsPlayerDonator[playerid] != 1) // Change to your function
        {
            ApplyAnimation(playerid, "ped", "CAR_doorlocked_LHS", 3.0, 0, 0, 0, 0, 0);
            SetVehicleParamsForPlayer(vehicleid,playerid,0,1);
            new Float:cx, Float:cy, Float:cz;
            GetPlayerPos(playerid, cx, cy, cz);
            SetPlayerPos(playerid, cx,  cy, cz);
            SendClientMessage(playerid,COLOR_GREY,"Car is reserved for donators.");
            ApplyAnimation(playerid, "ped", "CAR_doorlocked_LHS", 3.0, 0, 0, 0, 0, 0);
        }
    }

Damn errors -_-

D:


pawn Код:
\gamemodes\Server1.pwn(291) : error 012: invalid function call, not a valid address
\gamemodes\Server1.pwn(291) : warning 215: expression has no effect
\gamemodes\Server1.pwn(291) : error 001: expected token: ";", but found ")"
\gamemodes\Server1.pwn(291) : error 029: invalid expression, assumed zero
\gamemodes\Server1.pwn(291) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


Error Line:

pawn Код:
if (IsDonatorCar(vehicleid) && !ispassenger));
Gah >.<
Reply
#9

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid == DONOR[1] || if(IsPlayerVipMember(playerid));
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOUR_BRED, "This is a DONOR vehicle!");
            return 1;
        }
    }
    return 0;
}
Reply
#10

Quote:
Originally Posted by TheNotorius
Посмотреть сообщение
Damn errors -_-

D:


pawn Код:
\gamemodes\Server1.pwn(291) : error 012: invalid function call, not a valid address
\gamemodes\Server1.pwn(291) : warning 215: expression has no effect
\gamemodes\Server1.pwn(291) : error 001: expected token: ";", but found ")"
\gamemodes\Server1.pwn(291) : error 029: invalid expression, assumed zero
\gamemodes\Server1.pwn(291) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


Error Line:

pawn Код:
if (IsDonatorCar(vehicleid) && !ispassenger));
Gah >.<
pawn Код:
if (IsDonatorCar(vehicleid) && !ispassenger)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)