SA-MP Forums Archive
[Tutorial]Making Gangs or Teams! - 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: [Tutorial]Making Gangs or Teams! (/showthread.php?tid=107426)

Pages: 1 2


[Tutorial]Making Gangs or Teams! - Tigerbeast11 - 09.11.2009

Hi all!

For those who dont know how to, Im going to teach you to make gangs and teams!


Open up pawno and start new file.
You will get a blank script.

Put this somewhere near the top of your script:

pawn Код:
new gTeam[MAX_PLAYERS];
#define TEAM_WORKERS 1
#define TEAM_AGENTS 2

Under OnGameModeInIt()

pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}
Now, go to this website and choose some skins, its up to you...
Ok, i will choose skins 16 and skin 174

Do this with your OnGameModeInIt:
pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(16, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
       AddPlayerClass(174, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}
Ok, so you have the skins set up!

Under OnPlayerRequestClass:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid,1541.2833, -1362.4741, 329.6457);//You can change these to your co-ordinates, read wiki for more info!
    SetPlayerFacingAngle(playerid, 360);
    SetPlayerCameraLookAt(playerid,1541.2833, -1362.4741, 329.6457);
    SetPlayerCameraPos(playerid,1540.8374,-1358.4910,329.4645);
   
    SetPlayerTeamFromClass(playerid, classid);//Add this line to the end!
    return 1;
}
Now... After OnPlayerRequestClass:

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
  if(classid == 0)
  {
             gTeam[playerid] = TEAM_WORKERS;
        SetPlayerTeam(playerid,TEAM_WORKERS);//You can delete this line if you want to allow team killing...
        GameTextForPlayer(playerid,"~g~Workers",10,0);
  }
  else if(classid == 1)
  {
             gTeam[playerid] = TEAM_AGENTS;
        SetPlayerTeam(playerid,TEAM_AGENTS);//Same for this!
        GameTextForPlayer(playerid,"~r~Agents",10,0);
  }
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(GetPlayerTeam(playerid) == TEAM_AGENTS)
    {
        SetPlayerPos(playerid,-2136.3921,-124.4632,36.5191);//Chnage this to the spawnpoint of your Agents Team!
        SetPlayerHealth(playerid,100);
    }
    else if(GetPlayerTeam(playerid) == TEAM_WORKERS)
    {
      SetPlayerHealth(playerid,100);
      SetPlayerPos(playerid,-2016.3192,130.2446,27.6875);//Chnage this to the spawnpoint of your Workers Team!
      }
    }
    return 1;
}
And thats it! I hope you found this tutorial helpful! More comming soon!





Note: Plz be kind, this is my first tutorial! And plz leave good comments.


Re: [Tutorial]Make Gangs or Teams! - [XST]O_x - 09.11.2009

Nice tutorial,But there's already one on wiki:
https://sampwiki.blast.hk/wiki/PAWN_tutorial
But nevermind,I appreciate your effort.
You know that's very nice trying to help other people.


Re: [Tutorial]Make Gangs or Teams! - Tigerbeast11 - 09.11.2009

Yes, they beat me to it LOL

But my tut explains more in less words


Re: [Tutorial]Make Gangs or Teams! - Lajko1 - 09.11.2009

Good job , yeah its on wiki to but its not bad if it is here too lol


Re: [Tutorial]Make Gangs or Teams! - Tigerbeast11 - 09.11.2009

Thnx for the nice comments guys! Its my first tutorial too


Re: [Tutorial]Making Gangs or Teams! - Tigerbeast11 - 09.11.2009

Sorry, dont mean to bump

Note: If you get any errors whilst compiling, plz post them here, ill try to help you fix them


Re: [Tutorial]Making Gangs or Teams! - retart441 - 09.11.2009

Your tutorial only shows the way that one class = one team. When there are so many more possibilities You should edit it with more things to do with the gTeam variable.


Re: [Tutorial]Making Gangs or Teams! - Tigerbeast11 - 09.11.2009

Ive only made it basic to teach newbies!

On my server, it is very complex =P


Re: [Tutorial]Making Gangs or Teams! - retart441 - 09.11.2009

Quote:
Originally Posted by Tigerbeast11
Ive only made it basic to teach newbies!

On my server, it is very complex =P
The newbies have to learn the complex stuff also, if you have it why not teach them.


Re: [Tutorial]Making Gangs or Teams! - (.Aztec); - 09.11.2009

Quote:
Originally Posted by retart441
Quote:
Originally Posted by Tigerbeast11
Ive only made it basic to teach newbies!

On my server, it is very complex =P
The newbies have to learn the complex stuff also, if you have it why not teach them.
Start out small.


Re: [Tutorial]Making Gangs or Teams! - retart441 - 09.11.2009

Quote:
Originally Posted by sizeof(Sky));
Quote:
Originally Posted by retart441
Quote:
Originally Posted by Tigerbeast11
Ive only made it basic to teach newbies!

On my server, it is very complex =P
The newbies have to learn the complex stuff also, if you have it why not teach them.
Start out small.
Ya but its a good lesson variables also.


Re: [Tutorial]Making Gangs or Teams! - Tigerbeast11 - 10.11.2009

Ok, ill make another tut of this but in a more complex way! How many skins do you want? Or how many gangs?


Re: [Tutorial]Making Gangs or Teams! - Peter_Corneile - 10.11.2009

Quote:
Originally Posted by Tigerbeast11
Ok, ill make another tut of this but in a more complex way! How many skins do you want? Or how many gangs?
Nice but needs a bit more explanation for those who dont know anything about PAWNO , the others will understand in this bit too


Re: [Tutorial]Making Gangs or Teams! - Tigerbeast11 - 10.11.2009

Quote:
Originally Posted by ►Peter Corneile [ideal-host.co.uk
◄ ]
Quote:
Originally Posted by Tigerbeast11
Ok, ill make another tut of this but in a more complex way! How many skins do you want? Or how many gangs?
Nice but needs a bit more explanation for those who dont know anything about PAWNO , the others will understand in this bit too
If I explain too much, the pro scripters start complaining saying this tut is too babyish. lol
what do i do?


Re: [Tutorial]Making Gangs or Teams! - dirkblok - 10.11.2009

Good tutorial, but there's one on the wiki i think


Re: [Tutorial]Making Gangs or Teams! - Peter_Corneile - 10.11.2009

Quote:
Originally Posted by Tigerbeast11
Quote:
Originally Posted by ►Peter Corneile [ideal-host.co.uk
◄ ]
Quote:
Originally Posted by Tigerbeast11
Ok, ill make another tut of this but in a more complex way! How many skins do you want? Or how many gangs?
Nice but needs a bit more explanation for those who dont know anything about PAWNO , the others will understand in this bit too
If I explain too much, the pro scripters start complaining saying this tut is too babyish. lol
what do i do?
Nothing , let it be like this .. I was just expressing my views


Re: [Tutorial]Making Gangs or Teams! - Tigerbeast11 - 10.11.2009

Quote:
Originally Posted by ►Peter Corneile [ideal-host.co.uk
◄ ]
Quote:
Originally Posted by Tigerbeast11
Quote:
Originally Posted by ►Peter Corneile [ideal-host.co.uk
◄ ]
Quote:
Originally Posted by Tigerbeast11
Ok, ill make another tut of this but in a more complex way! How many skins do you want? Or how many gangs?
Nice but needs a bit more explanation for those who dont know anything about PAWNO , the others will understand in this bit too
If I explain too much, the pro scripters start complaining saying this tut is too babyish. lol
what do i do?
Nothing , let it be like this .. I was just expressing my views
Ok! Anymore comments?


Re: [Tutorial]Making Gangs or Teams! - Tigerbeast11 - 11.11.2009

Bump! Plz comment here if you found this topic useful!


Re: [Tutorial]Making Gangs or Teams! - Peter_Corneile - 11.11.2009

Quote:
Originally Posted by Tigerbeast11
Bump! Plz comment here if you found this topic useful!
Why do you need to bump this topic ? People will comment themself if they like


Re: [Tutorial]Making Gangs or Teams! - Tigerbeast11 - 11.11.2009

Quote:
Originally Posted by ►Peter Corneile [ideal-host.co.uk
◄ ]
Quote:
Originally Posted by Tigerbeast11
Bump! Plz comment here if you found this topic useful!
Why do you need to bump this topic ? People will comment themself if they like
LOL, yes, but i want more people to see my topic. If they dont see it, then i wont get any good coments, will I?