Quote:
Originally Posted by GTLS
PHP код:
if(!strcmp(cmd, "/darcash", true)) //Under OnPlayerCommandText
{
if(JogadorInfo[playerid][pAdmin] < 1342 || IsPlayerAdmin(playerid)) return SendClientMessage(playerid, iCor_Chat, "Vocк nгo й Administrador Dono");
if(sscanf(params, "dd", iIdSmir, iTotalCash)) return SendClientMessage(playerid, iCor_Chat, "USO: /darcash [ID] [Quantidade]");
if(!IsPlayerConnected(iIdSmir)) return SendClientMessage(playerid, iCor_Chat, "ID Nгo Conectado");
GetPlayerName(playerid, Nome, sizeof(Nome));
GetPlayerName(iIdSmir, Nome2, sizeof(Nome2));
format(iCelulas, sizeof(iCelulas), "[ iShoppinG ]: %s Deu %d Cash's Para o Jogador %s", Nome, iTotalCash, Nome2);
SmirnoffReceberMensagens(COLOR_YELLOW,iCelulas,1);
format(iCelulas, sizeof(iCelulas), "Vocк Recebeu [%d] de Cash do Administrador [%s]", iTotalCash, Nome);
SendClientMessage(iIdSmir, COLOR_LIGHTBLUE, iCelulas);
JogadorInfo[playerid][pCoins] += iTotalCash;
AtualizarCash(iIdSmir);
return 1;
}
It was literally one line change... and refrain from saying you'll +rep for help cuz people tend not to help sometimes.
|
This will not work, since you did not extract any of the command parameters.
To OP: Why even convert to strcmp? It's old, slow and there are much better command processors available, such as ZCMD.