[Include] gTeams - w/ Example GM (BETA)
#1


gTeams- Easy include to create teams!
What is this?
Well, I figured out that most of the time for me SetPlayerTeam does not work with a anti-team kill usually it glitches and works for certain players only. This INC contains all certain things when it comes to creating teams, its a simple include but will require some things to it in order to compile your script.

Includes/Packages needed:
  • OnPlayerShootPlayer
  • YSI/y_hooks
Note: I've tested with 3 players only, not sure if there are any bugs or errors in the code, if so anything is found please hit up a PM or reply to the thread, thanks!

Logs/Updates
Код:
** Just released 
OnPlayerShootPlayer has been hooked.
Functions
gT: Can be used as gTeam_, its pre-defined
pawn Код:
/*
    native gTeam_CreateTeam(teamname[], teamid, color, bool: teamscore)
    native gTeam_ToggleAntiTeamKill(bool: toggle)
    native gTeam_SetPlayerTeam(playerid, teamid)
    native gTeam_SetTeamDeathPenalty(penaltyid)
    native GetTeamName(teamid)
    native GetTeamCount()
    native gGetPlayerTeam(playerid)
    native SetTeamScoreRate(adder = 1, multiplier = 0)
    native GetTeamScore(teamid)
    native SetTeamScore(teamid, score)
    native GiveTeamScore(teamid, score)
    native ReturnPlayerName(pid)
    native bool:IsPlayerSpawned(pid)
*/
gTeam_CreateTeam(teamname[], teamid, color, bool: teamscore)
teamname - Creates a team name for the specific team.
teamid - Team ID you want it to be created as.
color - Color of the team
bool:teamscore - Activate team scoring.

NOTE: MOST FUNCTIONS WILL NOT WORK WITHOUT A VALID TEAM!

gTeam_ToggleAntiTeamKill(bool: toggle)
toggle - true = yes; false = no; Enables anti team kill

gTeam_SetPlayerTeam(playerid, teamid)
playerid - playerid
teamid - the teamid selected


gTeam_SetTeamDeathPenalty(penaltyid)
penatlyid -sets the penalty to the killer once a team kill is made

GetTeamName(teamid)
teamid - the teamid selected

GetTeamCount()
No parameters

gGetPlayerTeam(playerid)
playerid - playerid

SetTeamScoreRate(adder = 1, multiplier = 0)
adder - How much to be added when a team score is added
multiplier - Multiples the adder by the number selected


GetTeamScore(teamid)
teamid - the teamid selected

SetTeamScore(teamid, score)
teamid - the teamid selected
score - score to be set to


GiveTeamScore(teamid, score)
teamid - the teamid selected
score - score to be added


ReturnPlayerName(pid) [EXTRA FUNCTION]
pid - playerid

bool:IsPlayerSpawned(pid) [EXTRA FUNCTION]
pid - playerid

Penaltys
pawn Код:
/* ** Penaltys ** */
#define MAX_PENALTYS            6 // There are currently 6!
 
#define PENALTY_NOTHING         0 // Do nothing...
#define PENALTY_KILL            1 // Kill the killerid
#define PENALTY_EXPLODE         2 // Explode the killerid
#define PENALTY_FLY             3 // Make the killerid fly
#define PENALTY_KICK            4 // Kick the player
#define PENALTY_WARN            5 // Warn the player
Bugs/Suggestions
"This include/gm has Not been fully tested, bugs will be fixed in future versions if reported, simply report them on the thread, ill check."

There may be bugs, may. I would like to repair them asap. (Highly doubt though)

gTeams - Example GM
Credits to LV-DM, stole some things off there to make this basic GM... Modern LV-TDM xD

3 Teams: Groove, Balla, Ninjas

Includes used: ZCMD, Foreach & gTeam!

Download is right below where the inc download link is!

Credits
ZCMD creator - ZeeX
Lorenc - Include
Wups - OnPlayerShootPlayer INC
****** - YSI library/foreach
lv-dm - Copied vehicles and spawns
expertprogrammer & Norbert_G - Testing with me <3

Download
Include Download (v 0.1)

Example Gamemode (v 0.1)


Need more information just ask, I didn't bother to check the topics grammar, ill look into it after I get prepared for something occurring tommrow
Reply
#2

Great job!

I liked it.
Reply
#3

I'm specialized in making different minigames, this could be useful for some co-op minigame Nice work!
Reply
#4

Quote:
Originally Posted by iMonk3y
Посмотреть сообщение
I'm specialized in making different minigames, this could be useful for some co-op minigame Nice work!
I wish to see that, though sometime I will make more scripts, its just I never release good things due to people copying the script and claiming as theres.. Annoying as hell, thanks for the comment xD

+: Added penalty list in the topic, so forgot :S
Reply
#5

Good job son, makes it easier for the starters begging for their gTeam help .
Reply
#6

What is the penatly of gTeam_SetTeamDeathPenalty(penaltyid)?
xD But the rest is cool
Nuff' said.
Reply
#7

Quote:
Originally Posted by FireCat
Посмотреть сообщение
What is the penatly of gTeam_SetTeamDeathPenalty(penaltyid)?
xD But the rest is cool
Nuff' said.
It's to cause a certain penalty to a player that has team killed a teammate.

TheKiller

Thanks furher!
Reply
#8

Why don't you hook the OnPlayerShootPlayer callback?
Reply
#9

Quote:
Originally Posted by wups
Посмотреть сообщение
Why don't you hook the OnPlayerShootPlayer callback?
Tried to, it just simply didn't work

pawn Код:
Hook:gTeam_OnPlayerShootPlayer(Shooter, Target, Float:HealthLost, Float:ArmourLost)
I guess players have to do it the manual way or the untidy version of hooking, though I'll do it later on
Reply
#10

Nice Job......
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)