/Cnn - С Aparece o Texto -
VivendoVirtual - 13.06.2013
pawn Код:
Fica Bugando Assim: Uso correto: /cnn [texto]
pawn Код:
COMMAND:cnn(playerid, params[])
{
new cmd[256], cmdtext[256], VVString[256], idx;
cmd = strtok(cmdtext, idx);
//------------------------------------------------------------------------//
if(IsPlayerAdmin(playerid) == 0) return 0;
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, COR_VERMELHO, "Uso correto: /cnn [texto]");
return 1;
}
format(VVString, sizeof(VVString), "~b~%s: ~w~%s",nome(playerid), result);
for(new i = 0; i < MAX_PLAYERS; i++)
if(GetDistanceBetweenPlayers(playerid, i) <= 50)
{
GameTextForPlayer(i, VVString, 5000, 5);
}
return 1;
}
Re: /Cnn - С Aparece o Texto -
BielCOP - 13.06.2013
pawn Код:
COMMAND:cnn(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrampando[playerid] == 0 && PlayerInfo[playerid][pAdmin] <= 7)
{
SendClientMessage(playerid, COLOR_GRAD1, "Para poder usar este comando, use /administrar.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[51];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
CheckText(playerid,result);
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /cnn <Escreva>");
return 1;
}
if(strlen(result) >= 50) { SendClientMessage(playerid,COLOR_GREY,"O mбximo de caracteres й de 50."); return 1; }
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, 5);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando!");
return 1;
}
}
return 1;
}
Re: /Cnn - С Aparece o Texto -
Blix - 13.06.2013
Quote:
Originally Posted by BielCOP
pawn Код:
COMMAND:cnn(playerid) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 1) { if(admtrampando[playerid] == 0 && PlayerInfo[playerid][pAdmin] <= 7) { SendClientMessage(playerid, COLOR_GRAD1, "Para poder usar este comando, use /administrar."); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[51];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; CheckText(playerid,result);
if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /cnn <Escreva>"); return 1; } if(strlen(result) >= 50) { SendClientMessage(playerid,COLOR_GREY,"O mбximo de caracteres й de 50."); return 1; }
format(string, sizeof(string), "~b~%s: ~w~%s",sendername,result);
//para que essa merda ?
for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { GameTextForPlayer(i, string, 5000, 5); } } return 1; } //////////////////////////////////////////////////////////////// else { SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando!"); return 1; } } return 1; }
|
vocк tem certeza que isso funciona ?
cada coisa isso ae nunca irб funcionar ..
#tуpico use sscanf.
Re: /Cnn - С Aparece o Texto -
BielCOP - 13.06.2013
Quote:
Originally Posted by Blix
vocк tem certeza que isso funciona ?
cada coisa isso ae nunca irб funcionar ..
#tуpico use sscanf.
|
Tu testou o cуdigo por acaso ? Para de ser incoerente.
Re: /Cnn - С Aparece o Texto -
Blix - 13.06.2013
Quote:
Originally Posted by BielCOP
Tu testou o cуdigo por acaso ? Para de ser incoerente.
|
larga de ser lerdo , para que usar loop se temos GameTextForAll ?
edit agora que notei mas bosta ainda , tu pegou de um gm velho ae tirou a strcmp e diz que arrumou ? olha cara do cйu cria vergonha na sua cara aprende as coisas para depois sair ensinando ae.
Re: /Cnn - С Aparece o Texto -
BielCOP - 13.06.2013
Bom, meu intuito foi ajudar, se o seu foi criticar, vaza.
Re: /Cnn - С Aparece o Texto -
Blix - 13.06.2013
Quote:
Originally Posted by BielCOP
Bom, meu intuito foi ajudar, se o seu foi criticar, vaza.
|
gord...
#tуpico ta ae uma base nem testei estou em linux , enfim deve estar certo , tenta ae ..
pawn Код:
COMMAND:cnn(playerid,params[]){
new c[128],string[128];
if(IsPlayerAdmin(playerid)){
if(sscanf(params,"s[128]",c)){
SendClientMessage(playerid,-1,"/cnn mensagem");
}
else{
format(string,sizeof(string),"%s",c);
GameTextForAll( string, 5000, 3 );
}
}
else {
SendClientMessage(playerid,-1,"vocк nгo й adm");
}
return true;
}
Re: /Cnn - С Aparece o Texto -
BielCOP - 13.06.2013
Vey, n to afim de brigar, entao de boa