SA-MP Forums Archive
cars rep + [help] - 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)
+--- Thread: cars rep + [help] (/showthread.php?tid=337189)



cars rep + [help] - oscar7610 - 25.04.2012

Hi how can I make team cars only unlockable for that team so other teams cant steal cars from other teams?


Re: cars rep + [help] - Andrew97 - 25.04.2012

I want to know that to....?


Re: cars rep + [help] - RollTi - 25.04.2012

Do you already define your Team?

if yes here is the example

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vid = GetPlayerVehicleID(playerid);
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetVehicleModel(vid) == 522)
        {
            if(!gTeam[playerid] != TEAM_COPS) return RemovePlayerFromVehicle(playerid); //if player is not team cop he cannot enter the vehicle id 522 which is NRG-500
        }
    }
    return 1;
}



Re: cars rep + [help] - oscar7610 - 25.04.2012

Quote:
Originally Posted by RollTi
Посмотреть сообщение
Do you already define your Team?

if yes here is the example

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vid = GetPlayerVehicleID(playerid);
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetVehicleModel(vid) == 522)
        {
            if(!gTeam[playerid] != TEAM_COPS) return RemovePlayerFromVehicle(playerid); //if player is not team cop he cannot enter the vehicle id 522 which is NRG-500
        }
    }
    return 1;
}
Im trying it and yes teams are defines I got 5 teams, But I got like 2 turismos in different teams. can I use /dl and their id?


Re: cars rep + [help] - oscar7610 - 25.04.2012

pawn Код:
C:\Users\Oscar\Desktop\*\Gangwarz\gamemodes\backup.pwn(1198) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.



Re: cars rep + [help] - antonio112 - 25.04.2012

Quote:
Originally Posted by oscar7610
Посмотреть сообщение
Im trying it and yes teams are defines I got 5 teams, But I got like 2 turismos in different teams. can I use /dl and their id?
Well, yes, you can also use the vehicle ID like this:

pawn Код:
if(GetPlayerVehicleID(playerid) == VehicleID) // Where VehicleID = Your vehicle ID in /dl



Re: cars rep + [help] - RollTi - 25.04.2012

Try antonio's way


Re: cars rep + [help] - oscar7610 - 25.04.2012

Quote:
Originally Posted by RollTi
Посмотреть сообщение
Try antonio's way
Still wont work please help.

this is mine

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vid = GetPlayerVehicleID(playerid);
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetVehicleModel(vid) == 522)
        {
        if(!gTeam[playerid] != BIKER) return RemovePlayerFromVehicle(playerid); //if player is not team cop he cannot enter the vehicle id 522 which is NRG-500
        }
    }
    return 1;
}
pawn Код:
C:\Users\Oscar\Desktop\*\Gangwarz\gamemodes\backup.pwn(1198) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.



Re: cars rep + [help] - oscar7610 - 25.04.2012

Its kicking me out of the vehicle even if its the real team.


Re: cars rep + [help] - antonio112 - 25.04.2012

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vid = GetPlayerVehicleID(playerid);
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetVehicleModel(vid) == 522)
        {
        if(gTeam[playerid] != BIKER) return RemovePlayerFromVehicle(playerid); //if player is not team cop he cannot enter the vehicle id 522 which is NRG-500
        }
    }
    return 1;
}