27.03.2010, 13:59
I made a command to see who's playing what, and at the moment it just goes like this:
When it should go:
Here's my command:
And here's my function:
I get no errors when compiling.
Quote:
Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: Name: James | Playing: |
Quote:
Name: James | Playing: Roleplay Name: Joe | Playing: Deathmatch |
pawn Код:
if (strcmp("/playing", cmdtext, true, 10) == 0)
{
new name[MAX_PLAYER_NAME], string[256], gametype[256];
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerName(i, name, sizeof(name));
gametype = GetPlayerGameType(i);
format(string, sizeof(string), "Name: %s | Playing: %s", name, gametype);
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}
pawn Код:
GetPlayerGameType(targetid) {
new gametypetext[256];
switch(PlayerInfo[targetid][GameType])
{
case 1: gametypetext = "Free For All";
case 2: gametypetext = "Team Deathmatch";
case 3: gametypetext = "Roleplay";
}
return gametypetext;
}