SA-MP Forums Archive
Sending two messages for one problem. - 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: Sending two messages for one problem. (/showthread.php?tid=277003)



Sending two messages for one problem. - Shockey HD - 16.08.2011

For an example.

pawn Код:
if(sscanf(params,"i",team)) SendClientMessage(playerid,COLOR_RED,"System: /selectteam [Team]");
But i also want it to send this message

pawn Код:
SendClientMessage(playerid,COLOR_RED,"Type /Teams for list of Teams");
So, if they type /sellectteam it will send them a message saying,

System: /Selectteam [Team]
Type /teams for list of teams.

I hope you guys understand.


Re: Sending two messages for one problem. - Scenario - 16.08.2011

pawn Код:
if(sscanf(params,"i",team)) SendClientMessage(playerid,COLOR_RED,"System: /selectteam [Team]"), SendClientMessage(playerid,COLOR_RED,"Type /Teams for list of Teams");
Just use a comma where a colon would be before each different function you want to use.


Re: Sending two messages for one problem. - SchurmanCQC - 16.08.2011

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
pawn Код:
if(sscanf(params,"i",team)) SendClientMessage(playerid,COLOR_RED,"System: /selectteam [Team]"), SendClientMessage(playerid,COLOR_RED,"Type /Teams for list of Teams");
Just use a comma where a colon would be before each different function you want to use.
Wouldn't that only work with return?

pawn Код:
return Function(), Function();

But also you can just use brackets? ... if(){ function(); function(); }

--
Here's a really cool gamemode!

pawn Код:
public OnGamemodeInit() {

return print("This forum requires that you wait 120 seconds between posts. Please try again in 61 seconds.");

}
It even makes your compiler sing Chacarron Macarron!


Re: Sending two messages for one problem. - Scenario - 16.08.2011

It works with every function- I do it all the time.

By the way, that's a nice mode.


Re: Sending two messages for one problem. - Shockey HD - 16.08.2011

Okay, thank you. Also, how can i do a random skins? For a TDM server?


Re: Sending two messages for one problem. - dowster - 16.08.2011

random(max);

if you want specific skins just throw them in an array and use random to get one from the array


Re: Sending two messages for one problem. - Scenario - 16.08.2011

Quote:
Originally Posted by dowster
Посмотреть сообщение
random(max);

if you want specific skins just throw them in an array and use random to get one from the array
You need to make sure that you set a minimum and a maximum as well as avoid the "bad skins."


Re: Sending two messages for one problem. - Shockey HD - 16.08.2011

Also, is there another way to do this.

pawn Код:
if(GetPlayerSkin(playerid) == 271)
    {
        PlayerInfo[playerid][pTeam] = 1;
    }
    else if(GetPlayerSkin(playerid) == 270)
    {
        PlayerInfo[playerid][pTeam] = 1;
    }
    else if(GetPlayerSkin(playerid) == 269)
    {
        PlayerInfo[playerid][pTeam] = 1;
    }
    else if(GetPlayerSkin(playerid) == 102)
    {
        PlayerInfo[playerid][pTeam] = 2;
    }
    else if(GetPlayerSkin(playerid) == 103)
    {
        PlayerInfo[playerid][pTeam] = 2;
    }
    else if(GetPlayerSkin(playerid) == 104)
    {
        PlayerInfo[playerid][pTeam] = 2;
    }
    else if(GetPlayerSkin(playerid) == 114)
    {
        PlayerInfo[playerid][pTeam] = 3;
    }
    else if(GetPlayerSkin(playerid) == 115)
    {
        PlayerInfo[playerid][pTeam] = 3;
    }
    else if(GetPlayerSkin(playerid) == 116)
    {
        PlayerInfo[playerid][pTeam] = 3;
    }
    return 1;
}
Sorry for all the questions


Re: Sending two messages for one problem. - Scenario - 16.08.2011

You could use cases:

pawn Код:
switch(GetPlayerSkin(playerid))
{
    case 269..271: PlayerInfo[playerid][pTeam] = 1;
    case 102..104: PlayerInfo[playerid][pTeam] = 2;
    case 114..116: PlayerInfp[playerid][pTeam] = 3;
}