SA-MP Forums Archive
This is last thread about DM - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: This is last thread about DM (/showthread.php?tid=277284)



This is last thread about DM - lyrics - 17.08.2011

Ok this is very very last last DM Thread
yeah i make all the problem is the color
i want when example

I choose Mafia Team it set my color blue
i want my color set to my color using last time

example i using Green when i was not on DM yet

How can i do that

EDITED: How can i also make Team Chat Example ! or /t How?


Re: This is last thread about DM - lyrics - 17.08.2011

Please help


Re: This is last thread about DM - [MG]Dimi - 17.08.2011

SetPlayerColor
for team chat read soem tutorials! Use loop to check teams of players and then send message

Also this is more infections for you for doubleposting. Continue like this and you'll get ban, just warning you.


Re: This is last thread about DM - Riddick94 - 17.08.2011

Shut up and stop bumping. Look into other DM scripts and then you will learn. Try do something by yourself not spamming topics and 'please, please! i gonna cry! help me!'


Re: This is last thread about DM - Basicz - 17.08.2011

pawn Код:
new
    pOldColour[ MAX_PLAYERS ]
;

CMD:dm( playerid, params[ ] ) // When a player joins DM
{
    // Your stuffs here...

    pOldColour[ playerid ] = GetPlayerColor( playerid );

    SetPlayerColor( playerid, 0x0000FFFF ); // Blue

    return 1;
}

CMD:leavedm( playerid, params[ ] ) // When a player leaves a deathmatch
{
    // Your stuffs here
 
    SetPlayerColor( playerid, pOldColour[ playerid ] );

    return 1;
}

// Teamchat
public OnPlayerText( playerid, text[ ] )
{
    if ( text[ 0 ] = '!' && text[ 1 ] != ' ' )
    {
        foreach (Player, i) // Loop
        {
            if ( gTeam[ playerid ] == gTeam[ i ] ) // if the team is same
            {
                new
                    szString[ 128 ],
                    pName[ 24 ]
                ;
                 
                GetPlayerName( playerid, pName, 24 );

                format( szString, 128, "TEAMCHAT [ %s ] : %s", pName, text );

                SendClientMessage( i, -1, szString );
            }
        }
    }

    return 1;
}



Re: This is last thread about DM - lyrics - 17.08.2011

Quote:
Originally Posted by Basicz
Посмотреть сообщение
pawn Код:
new
    pOldColour[ MAX_PLAYERS ]
;

CMD:dm( playerid, params[ ] ) // When a player joins DM
{
    // Your stuffs here...

    pOldColour[ playerid ] = GetPlayerColor( playerid );

    SetPlayerColor( playerid, 0x0000FFFF ); // Blue

    return 1;
}

CMD:leavedm( playerid, params[ ] ) // When a player leaves a deathmatch
{
    // Your stuffs here
 
    SetPlayerColor( playerid, pOldColour[ playerid ] );

    return 1;
}
Thanks dude your better than those who commend like

Use your own way

-

I'm gonna cry help me

thats suck


Re: This is last thread about DM - Adil - 17.08.2011

It's all about variables, and saving them. You make a variable called something like new pTeam[MAX_PLAYERS]; and then change it to the team number on OnPlayerSpawn. If you want to save the Team ID, so the player automatically gets the same Team when he connects in again, you have to save the Team ID on OnPlayerDisconnect in his userfiles. And then just load it on OnPlayerConnect.

pawn Код:
if(strcmp(string, "/team", true) == 0 || strcmp(string, "/t", true) == 0)
{
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp))
    {
        SendClientMessage(playerid, COLOR_GREY, "USAGE: /(t)eam [chat]");
        return 1;
    }    
    length = strlen(cmdtext);
    while((idx < object) && (cmdtext[idx] <= ' '))
    {
        idx++;
    }
    new offset = idx;
    new result[64];
    while((idx < object) && ((idx - offset) < (sizeof(result) - 1)))
    {
        result[idx - offset] = cmdtext[idx];
        idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
        SendClientMessage(playerid, COLOR_GREY, "USAGE: /(t)eam [chat]");
         return 1;
    }
    GetPlayerName(playerid, string, sizeof(string));
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(pTeam[playerid] == pTeam[i])
        {
            format(string, sizeof(string), "%s says: %s", string, reason);
            if(pTeam[playerid] == 1)
            {
                SendClientMessage(i, COLOR_BLUE, string);
            }
            else if(pTeam[playerid] == 2)
            {
                SendClientMessage(i, COLOR_RED, string);
            }
        }
    }
}



Re: This is last thread about DM - lyrics - 17.08.2011

Not working


Re: This is last thread about DM - Basicz - 17.08.2011

Try my TeamChat, use '!<Text>' ingame, no spaces.

pawn Код:
// Teamchat
public OnPlayerText( playerid, text[ ] )
{
    if ( text[ 0 ] = '!' && text[ 1 ] != ' ' )
    {
        foreach (Player, i) // Loop
        {
            if ( gTeam[ playerid ] == gTeam[ i ] ) // if the team is same
            {
                new
                    szString[ 128 ],
                    pName[ 24 ]
                ;
                 
                GetPlayerName( playerid, pName, 24 );

                if ( text[ 0 ] == '!' )
                    text[ 0 ] = ' ';

                format( szString, 128, "TEAMCHAT [ %s ] :%s", pName, text );

                SendClientMessage( i, -1, szString );
            }
        }
    }

    return 1;
}
Remember, change 'gTeam' variable to your code's 'gTeam' variable.

Also you need foreach for my code.


Re: This is last thread about DM - lyrics - 17.08.2011

1 Warning


Код:
H:\GTA San Andreas\SAMP Server\gamemodes\XtremeKakashiV2.pwn(635) : warning 211: possibly unintended assignment
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.