Help team
#1

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 код:
     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);
                 }
        }
     } 
Reply
#2

PHP код:
// 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);

Reply
#3

Where do I put this
PHP код:
// 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
Reply
#4

Quote:
Originally Posted by Spawe
Посмотреть сообщение
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 код:
// Question 1 
if(issuerid == INVALID_PLAYER_ID)return 1

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

return 
0

Quote:
Originally Posted by Spawe
Посмотреть сообщение
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 код:
SpawnPlayer(the person who you want to respawn); 
Reply
#5

Use spawnplayer
PHP код:
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
Reply
#6

Quote:
Originally Posted by Spawe
Посмотреть сообщение
Use spawnplayer
PHP код:
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)