10.04.2010, 01:39
sry for not posting in the "code"..firstly
below the #includes:
forward radiomessage();
new pclass[MAX_PLAYERS]
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//----------------------------
at:
public OnPlayerRequestClass(playerid, classid)
{
pclass[playerid] = classid;
return1;
}
//----------------------------
Anywhere:
public radiomessage()
{
for(new i=0; i < GetMaxPlayers; i++)
if(IsPlayerConnected(i)){
if(pclass[playerid] == 106 || pclass[playerid}] == 105 || pclass[playerid}] == 107){
SendClientMessage(i, color, string);
}
}
return 1;
}
//----------------------------
Anywhere:
dcmd_r(playerid, params[])
{
new pname[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s in Radio: %s", pname, params);
radiomessage(COLORYOUWANT, string);
return 1;
}
//----------------------------
At:
OnPlayerCommandText(playerid, cmdtext);
{
dcmd(r, 1, cmtext);
return 1;
}
Try that...
below the #includes:
forward radiomessage();
new pclass[MAX_PLAYERS]
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//----------------------------
at:
public OnPlayerRequestClass(playerid, classid)
{
pclass[playerid] = classid;
return1;
}
//----------------------------
Anywhere:
public radiomessage()
{
for(new i=0; i < GetMaxPlayers; i++)
if(IsPlayerConnected(i)){
if(pclass[playerid] == 106 || pclass[playerid}] == 105 || pclass[playerid}] == 107){
SendClientMessage(i, color, string);
}
}
return 1;
}
//----------------------------
Anywhere:
dcmd_r(playerid, params[])
{
new pname[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s in Radio: %s", pname, params);
radiomessage(COLORYOUWANT, string);
return 1;
}
//----------------------------
At:
OnPlayerCommandText(playerid, cmdtext);
{
dcmd(r, 1, cmtext);
return 1;
}
Try that...