06.01.2012, 01:49
tenta assim:
PHP код:
//----------------------------------[cnn]-----------------------------------------------
if(strcmp(cmd, "/cnn", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1340 && PlayerInfo[playerid][pAdmin] != 1341)
{
MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
return 1;
}
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))
{
MSGPLAYER(playerid, COLOR_GRAD2, "USE: /cnn [cnn formato ~n~=NovaLinha ~r~=Vermelho ~g~=Verde ~b~=Azul ~w~=Branco ~y~=Amarelo ~l~=Preto]");
return 1;
}
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
format(string, sizeof(string), "~b~felipe_mr: ~w~%s",result);
}
else
{
format(string, sizeof(string), "~b~%s: ~w~%s",sendername,result);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GameTextForPlayer(i, string, 5000, 3);
}
}
return 1;
}
else
{
MSGPLAYER(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando!");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/cnnn", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
tmp = strtok(cmdtext, idx);
new txtid;
if(!strlen(tmp))
{
MSGPLAYER(playerid, COLOR_GRAD2, "USE: /cnnn <Digite> ");
return 1;
}
txtid = strval(tmp);
if(txtid == 2)
{
MSGPLAYER(playerid, COLOR_GRAD2, "Nгo existe 2! sу 0,1,3,4!");
return 1;
}
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))
{
MSGPLAYER(playerid, COLOR_GRAD2, "USE: /cnnn <Digite> [cnnc formato ~n~=NovaLinha ~r~=Vermelho ~g~=Verde ~b~=Azul ~w~=Branco ~y~=Amarelo ~l~=Preto]");
return 1;
}
format(string, sizeof(string), "~w~%s",result);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
GameTextForPlayer(i, string, 5000, txtid);
}
}
return 1;
}
else
{
MSGPLAYER(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
return 1;
}
}
return 1;
}