My teamchat fails
#3

Thanks mate! it worked perfectly.

Код:
public OnPlayerStateChange(playerid, newstate, oldstate) // This function checks if the state of a player is changing.
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new numero = GetPlayerVehicleID(playerid);
        if(numero == BallasVeh)
        {
            if(gTeam[playerid] == TEAM_BALLA)
            {
                SendClientMessage(playerid,0xFF0000AA, "You can't steal your own gang car!");
                RemovePlayerFromVehicle(playerid);
            }
            else if(gTeam[playerid] == TEAM_GROVE)
            {
            		new grovename[MAX_PLAYER_NAME];
             		new string[256];
             		new str[256];
             		GetPlayerName(playerid, grovename, sizeof(grovename));
                SetPlayerCheckpoint(playerid, 2412.2483,-1854.1670,1.1559, 6.5);
                SendClientMessage(playerid, 0x33AA33AA, "You have stolen Ballas' gang vehicle! Get it to the checkpoint!");
       					if (gTeam[playerid] == TEAM_GROVE)
    							{
    							format(string, sizeof(string), "(TEAM) *** Your teammate ( %s ) is stealing Ballas' gang vehicle! Go help him! ***", grovename);
      							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
									}
     						if (gTeam[playerid] == TEAM_BALLA)
									{
 									format(str, sizeof(str), "(TEAM) *** %s is stealing your gang vehicle! Stop him before he enters the checkpoint! ***", grovename);
      							SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
									}
            }
        }
        else if(numero == GroveVeh)
        {
            if(gTeam[playerid] == TEAM_GROVE)
            {
                SendClientMessage(playerid,0xFF0000AA, "You can't steal your own gang car!");
                RemovePlayerFromVehicle(playerid);
            }
            else if(gTeam[playerid] == TEAM_BALLA)
            {
                new ballasname[MAX_PLAYER_NAME];
                new string[256];
                new str[256];
                GetPlayerName(playerid, ballasname, sizeof(ballasname));
                SendClientMessage(playerid, 0x33AA33AA, "You have stolen the Grove's gang vehicle! Get it to the checkpoint!");
    						SetPlayerCheckpoint(playerid, 2412.2483,-1854.1670,1.1559, 6.5);
                if (gTeam[playerid] == TEAM_BALLA)
									{
    							format(string, sizeof(string), "(TEAM) *** Your teammate ( %s ) is stealing Grove's gang vehicle! Go help him! ***", ballasname);
      							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
									}
     						if (gTeam[playerid] == TEAM_GROVE)
									{
 									format(str, sizeof(str), "(TEAM) *** %s is stealing your gang vehicle! Stop him before he enters the checkpoint! ***", ballasname);
      							SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
									}
            }
        }
    }
    else if(newstate == PLAYER_STATE_ONFOOT)
    {
      DisablePlayerCheckpoint(playerid);
      SetVehicleParamsForPlayer(GroveVeh,playerid,0,0);
    	SetVehicleParamsForPlayer(BallasVeh,playerid,0,0);
    }
    return 1;
}
One more questoin, in this script the gang message is only sent to the playerid in the car. How can i make it sent the message to everybody?
Reply


Messages In This Thread
My teamchat fails - by GTA_Rules - 28.03.2009, 08:55
Re: My teamchat fails - by pen_theGun - 28.03.2009, 09:27
Re: My teamchat fails - by GTA_Rules - 28.03.2009, 11:56
Re: My teamchat fails - by [M2S]moe - 28.03.2009, 12:56
Re: My teamchat fails - by GTA_Rules - 28.03.2009, 14:10
Re: My teamchat fails - by introzen - 28.03.2009, 14:20
Re: My teamchat fails - by GTA_Rules - 28.03.2009, 17:34
Re: My teamchat fails - by Backwardsman97 - 28.03.2009, 17:40
Re: My teamchat fails - by GTA_Rules - 28.03.2009, 21:14
Re: My teamchat fails - by pen_theGun - 28.03.2009, 23:07

Forum Jump:


Users browsing this thread: 1 Guest(s)