SA-MP Forums Archive
Car Thing - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Car Thing (/showthread.php?tid=222780)



Car Thing - TheNotorius - 08.02.2011

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


Re: Car Thing - Haydz - 08.02.2011

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


Re: Car Thing - TheNotorius - 08.02.2011

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


Re: Car Thing - jaydon - 08.02.2011

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


Re: Car Thing - TheNotorius - 08.02.2011

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?


Re: Car Thing - TheNotorius - 08.02.2011

*BUMP..*


Re: Car Thing - SaW_[VrTx] - 08.02.2011

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);
        }
    }



Re: Car Thing - TheNotorius - 09.02.2011

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 >.<


Re: Car Thing - ricardo178 - 09.02.2011

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;
}



Re: Car Thing - SaW_[VrTx] - 09.02.2011

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)