Sending two messages for one problem.
#1

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.
Reply
#2

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.
Reply
#3

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!
Reply
#4

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

By the way, that's a nice mode.
Reply
#5

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

random(max);

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

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."
Reply
#8

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
Reply
#9

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)