21.11.2009, 03:30
pawn Код:
/*
I am trying to make it only shows these announces when you are in a deathmatch.
In my Game Mode I use a bool to define if they are in a deathmatch or not. But I am
trying it this way because I coudlent figure out how to do it with a bool. I am not sure
how to do this with GameTextForAll but only send it to the people in DM zones.
*/
#include <a_samp>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
enum PlayerData
{
DMMSG,
};
new PlayerInfo[MAX_PLAYERS][PlayerData];
forward deathmatchmessages(color,const string[]);
public deathmatchmessages(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][DMMSG] == 1) SendClientMessage(i, color, string); //I get a tag mismatch here if I change SendClientMessage to GameTextForAll
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(testing, 7, cmdtext);
return 0;
}
dcmd_testing(playerid, params[])
{
#pragma unused params
#pragma unused playerid
new string [128];
format(string, sizeof(string), "The Bomb is ticking at A");
GameTextForAll(string, 5000, 1); deathmatchmessages(0x33FF33AA,string); //Sommething weird here?
return 1;
}