05.02.2012, 23:57
(
Последний раз редактировалось Lord_Ching; 06.02.2012 в 00:36.
)
pawn Код:
// No topo do GM
enum Org
{
pGroove,
pBallas,
};
new Orgs[MAX_PLAYERS][Org];
//Em OnPlayerCommandText
if(strcmp(cmd, "/radioprof", true) == 0 || strcmp(cmd, "/rp", true) == 0)
{
if(Groove(playerid) >= 1)
{
GetPlayerName(playerid, pName, sizeof pName);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid, CINZA, "USE: /rp [TEXTO]");
format(CELULAS, sizeof(CELULAS), "Chat Prof - %s: %s", pName, result);
SendMessageToGroove(AZUL,CELULAS);
}
if(Ballas(playerid) >= 1)
{
GetPlayerName(playerid, pName, sizeof pName);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid, CINZA, "USE: /rp [TEXTO]");
format(CELULAS, sizeof(CELULAS), "Chat Prof - %s: %s", pName, result);
SendMessageToBallas(AZUL,CELULAS);
}
return 1;
}
//No fim do GM
stock Groove(playerid)
{
new Groove1;
Groove1 = Orgs[playerid][pGroove];
return Groove1;
}
stock Ballas(playerid)
{
new Ballas1;
Ballas1 = Orgs[playerid][pBallas];
return Ballas1;
}
forward SendMessageToGroove(color,const string[]);
public SendMessageToGroove(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
if(Groove(i) >= 1)
{
SendClientMessage(i, color, string);
}
}
}
return 1;
}
forward SendMessageToBallas(color,const string[]);
public SendMessageToBallas(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
if(Ballas(i) >= 1)
{
SendClientMessage(i, color, string);
}
}
}
return 1;
}