29.11.2013, 13:05
I want to creat and chat for medics and i used this
and on OnPlayerCommandText i have
when i write in game
the server say me that my comand don't exist and in log appear that
if i write
they say me that
How i can repair this?
+1rec for good respons
Код:
dcmd_r(playerid, params[]) { if(strcmp(factiune[playerid],"Medic",true) == 0) { new text[128]; if(sscanf(params,"s", text)) return SendClientMessage(playerid, 0xFFFFFFF,"Comanda gresita. Corect: /r text pentru a transmite ceva colegilor de factiune"); new strr[128]; for (new i = 1; i <= MAX_PLAYERS; i++) { new medicnume[128]; GetPlayerName(i, medicnume, sizeof(medicnume)); if (strcmp(factiune[i],"Medic",true) == 0) { format(strr,sizeof(strr),"Mesaj: \"%s\".",text); SendClientMessage(i, 0xFF00FFFF , strr); } } } else { SendClientMessage(playerid, 0xFF00FFFF , "Nu esti Medic sau Politist."); } return 1; }
Код:
dcmd(r, 1, cmdtext);
Код:
/r text
Код:
sscanf warning: Strings without a length are deprecated, please add a destination size.
Код:
/r
Код:
Comanda gresita. Corect: /r text pentru a transmite ceva colegilor de factiune
+1rec for good respons