SA-MP Forums Archive
help me pls - 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: help me pls (/showthread.php?tid=529690)



help me pls - Diti1 - 03.08.2014

hey boys
Can some one of you help me with something i made teams grove street and Police and i made cars that can be used only from they but it wont work Police team cant use police car and grove street can use police car and not grove street car i tried to change teams but still wont work can some one give me pawno please



Sorry for my bad english xD :P


Re: help me pls - LarryTiger - 03.08.2014

Well, If you are making a car in one team, Make sure you use DEBUG,

And also theres have a tutorial in ******* that showing how to make a team characters,Team Car, Check below the video

[ame]http://www.youtube.com/watch?v=4Qe6NbLm5bc[/ame]


Re: help me pls - Diti1 - 03.08.2014

okay thanks im checking video , do you know anything for factions to creat one ?


Re: help me pls - Stinged - 03.08.2014

I'm not going to create a whole script just so you can fix this.
Post your teams and car teams codes.


Re: help me pls - Diti1 - 03.08.2014

lol did i asked you i said some one who can help me not script =_=


Re: help me pls - ViniBorn - 03.08.2014

Without code, is hard to help you


Re: help me pls - Diti1 - 03.08.2014

okay here you go


Quote:

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == Cars[Police] )
{
if(gTeam[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
return 1;
}
}
if(CarCheck == Cars[GroveStreet] )
{
if(gTeam[playerid] != 2)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
return 1;
}
}
return 1;
}
return 1;
}


police team got number 2 and grove got number 1


Re: help me pls - Diti1 - 03.08.2014

Help me please


Re: help me pls - Dj_maryo1993 - 03.08.2014

pawn Код:
new ownedcarteam[MAX_VEHICLES];
new tempvarforcar;

OnGameModeInit()
{
  //blabla rest of the code
  tempvarforcar =  CreateVehicle(blablacoordsandstuff); // police car 1
  ownedcarteam[tempvarforcar] = 1; // police car
  tempvarforcar =  CreateVehicle(blablacoordsandstuff); // police car 2
  ownedcarteam[tempvarforcar] = 1; // police car
  tempvarforcar =  CreateVehicle(blablacoordsandstuff); // grove car 1
  ownedcarteam[tempvarforcar] = 2; // grove car
  tempvarforcar =  CreateVehicle(blablacoordsandstuff); // police car 2
  ownedcarteam[tempvarforcar] = 2; //grove car
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(ownedcarteam[GetPlayerVehicleID(playerid)] >0) // checking to see if the car is assinged to any team
  {
    if(ownedcarteam[GetPlayerVehicleID(playerid)] != gTeam[playerid]) // wrong car team
    {
      ClearAnimations(playerid);
    }
  }
}



Re: help me pls - Diti1 - 03.08.2014

it wont work dude i got alot of warns/errors