29.02.2012, 16:08
if(strcmp(cmd, "/ORG1", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(playerid, sendername, sizeof(sendername));
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))
{
SendClientMessage(playerid, COLOR_GREEN, "USO: /ORG1 [texto]");
return 1;
}
if(logado[playerid] == 1)
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][ORG 1] >= 1)
{
format(string, sizeof(string), "ORG 1 - %s: %s", sendername, result);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][CV] >= 1)
{
SendClientMessage(i,COLOR_RED, string);
}
}
}
printf(string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_CYAN, "Vocк nгo estб autorizado a usar o Chat do CV.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_CYAN, "Vocк tem que estar logado para usar este comando!");
}
}
_____________________________
troca o org 1 pela sua org :] ti ajudei ? da thanks :] vllws
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(playerid, sendername, sizeof(sendername));
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))
{
SendClientMessage(playerid, COLOR_GREEN, "USO: /ORG1 [texto]");
return 1;
}
if(logado[playerid] == 1)
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][ORG 1] >= 1)
{
format(string, sizeof(string), "ORG 1 - %s: %s", sendername, result);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][CV] >= 1)
{
SendClientMessage(i,COLOR_RED, string);
}
}
}
printf(string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_CYAN, "Vocк nгo estб autorizado a usar o Chat do CV.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_CYAN, "Vocк tem que estar logado para usar este comando!");
}
}
_____________________________
troca o org 1 pela sua org :] ti ajudei ? da thanks :] vllws