SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 10/11/2018, 10:21 PM   #1
Spawe
Big Clucker
 
Spawe's Avatar
 
Join Date: Sep 2018
Posts: 53
Reputation: 2
Default Help team

someone helps me with this

1)How to place the anti team kill

2)How to optimize the code so that no error

3)When a player of one team eliminates another one, they rejoin their position

4)How can I make a command to change the team?

I will give more +reputation

Code: OnDialogResponse

PHP Code:
     if(dialogid == DIALOG_TEAMS)
     {
        if(
response)
        {
                 if(
listitem == 0//Dragons
                 
{
                         
SetSpawnInfo(playerid0179,  318.8639,1121.6978,1083.8828,180.165924,9999924,9999924,99999);
                         if(
gTeam[playerid] == DRAGONS) { SetPlayerTeam(playerid179); }
                         
SetPlayerColor(playeridCOLOR_DRAGONS);
                         
SetPlayerSkin(playeridDragons[random(3)]);
                         
SetPlayerInterior(playerid5);
                         
SetPlayerHealth(playerid100);
                         
SpawnPlayer(playerid);
                 }
                 if(
listitem == 1//Templarios
                 
{
                         
SetSpawnInfo(playerid12062264.5317,-1209.7946,1049.0234,253.036724,9999924,9999924,99999);
                           if(
gTeam[playerid] == TEMPLARIO) { SetPlayerTeam(playerid206); }
                           
SetPlayerColor(playeridCOLOR_TEMPLARIOS);
                           
SetPlayerSkin(playeridTemplarios[random(3)]);
                         
SetPlayerInterior(playerid10);
                         
SetPlayerHealth(playerid100);
                         
SpawnPlayer(playerid);
                 }
        }
     } 
__________________
¿You want to belong to my project in Spanish?
Enter my discord group

Last edited by Spawe; 10/11/2018 at 11:10 PM.
Spawe is offline   Reply With Quote
Old 11/11/2018, 03:38 AM   #2
Leaky
Little Clucker
 
Join Date: Jul 2018
Posts: 39
Reputation: 9
Default Re: Help team

PHP Code:
// Question 1
if(issuerid == INVALID_PLAYER_ID)return 1;
{
if(
gTeam[playerid] == gTeam[issuerid] )
{
return 
0;
}
2)/*So far i haven't seen any errors. If you get some i'd suggest you posting them here or better yet there are some threads posted around with error/warning fixes you can read those to learn*/

3)//Not sure what you mean by rejoin his/her position.

4)
CMD:changeteam(playerid)
{
 
ForceClassSelection(playerid);

__________________

Last edited by Leaky; 11/11/2018 at 06:02 AM.
Leaky is offline   Reply With Quote
Old 11/11/2018, 05:13 AM   #3
Spawe
Big Clucker
 
Spawe's Avatar
 
Join Date: Sep 2018
Posts: 53
Reputation: 2
Default Re: Help team

Where do I put this
PHP Code:
// Question 1 
if(issuerid == INVALID_PLAYER_ID)return 1

if(
gTeam[playerid] == TEAM_1 && gTeam[issuerid] == TEAM_1

return 
0

putting that and those of the same team can not hurt themselves?

Quote:
3)//Not sure what you mean by rejoin his/her position.
When a player of a team eliminates another one falls to the emptiness in Fort Carson prison and dies he does not go again to his place of spawn
__________________
¿You want to belong to my project in Spanish?
Enter my discord group
Spawe is offline   Reply With Quote
Old 11/11/2018, 06:08 AM   #4
Leaky
Little Clucker
 
Join Date: Jul 2018
Posts: 39
Reputation: 9
Default Re: Help team

Quote:
Originally Posted by Spawe View Post
Where do I put this
putting that and those of the same team can not hurt themselves?
Place this under onplayertakedamage or at on playergivedamage
PHP Code:
// Question 1 
if(issuerid == INVALID_PLAYER_ID)return 1

if(
gTeam[playerid] == gTeam[issuerid]) 

return 
0

Quote:
Originally Posted by Spawe View Post
When a player of a team eliminates another one falls to the emptiness in Fort Carson prison and dies he does not go again to his place of spawn
Use spawnplayer
PHP Code:
SpawnPlayer(the person who you want to respawn); 
__________________
Leaky is offline   Reply With Quote
Old 11/11/2018, 07:12 AM   #5
Spawe
Big Clucker
 
Spawe's Avatar
 
Join Date: Sep 2018
Posts: 53
Reputation: 2
Default Re: Help team

Use spawnplayer
PHP Code:
SpawnPlayer(the person who you want to respawn); 
[/QUOTE]

If that function forces the player to spawnear but I want it to be OnPlayerDeath for example:

Team 1 eliminate a player from team 2 and this spawnee in the corresponding coordinates look at the OnDialogResponse Look at the code that passes previously
__________________
¿You want to belong to my project in Spanish?
Enter my discord group
Spawe is offline   Reply With Quote
Old 11/11/2018, 09:36 AM   #6
Leaky
Little Clucker
 
Join Date: Jul 2018
Posts: 39
Reputation: 9
Default Re: Help team

Quote:
Originally Posted by Spawe View Post
Use spawnplayer
PHP Code:
SpawnPlayer(the person who you want to respawn); 
If that function forces the player to spawnear but I want it to be OnPlayerDeath for example:

Team 1 eliminate a player from team 2 and this spawnee in the corresponding coordinates look at the OnDialogResponse Look at the code that passes previously[/QUOTE]

What i got from what you are saying is you want to spawn a player somewhere else under the OnplayerDeath callback? if that's what you are trying to do, that not possible. I'd suggest that you put the dialog at onplayerspawn, so they will choose where to spawn each time they have died.
__________________
Leaky is offline   Reply With Quote
Old 11/11/2018, 07:27 PM   #7
Spawe
Big Clucker
 
Spawe's Avatar
 
Join Date: Sep 2018
Posts: 53
Reputation: 2
Default Re: Help team

Quote:
Originally Posted by Leaky View Post
What i got from what you are saying is you want to spawn a player somewhere else under the OnplayerDeath callback? if that's what you are trying to do, that not possible. I'd suggest that you put the dialog at onplayerspawn, so they will choose where to spawn each time they have died.
want the following:

when a team 1 player eliminates a team 2 the player back to the place that corresponds to the spawn of the selected team

the anti team kill does not work, I have it like that

Team 1 player can shoot the team player 1

PHP Code:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponid)
{
    if(
issuerid == INVALID_PLAYER_ID)return 1;
    {
    if(
gTeam[playerid] == gTeam[issuerid])
    {
    if(
IsPlayerConnected(issuerid))PlayerPlaySound(issuerid178020.00.00.0);
    }
    return 
0;
  }

__________________
¿You want to belong to my project in Spanish?
Enter my discord group
Spawe is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] Team System (avoid team abuses and some functions) Gammix Tutorials 45 15/08/2015 02:04 PM
Adding team color to map and restricted team base FunnyBear Scripting Help 3 11/11/2014 09:22 PM
Random team assigning, team members limit: Twizted Scripting Help 2 20/07/2014 02:05 PM
I am unable to use KEY_WALK for a team but for other team it works. Gaurav_Rawat Scripting Help 4 30/04/2014 05:27 PM
[Tutorial] How to make groups/teams and how to set team cars and team cmds.(y_groups / y_classes / y_commands) Scrillex Tutorials 30 11/03/2013 05:01 AM


All times are GMT. The time now is 06:27 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.