29.11.2013, 13:24
You'll need to add the size to the "s" specifier. For example:
But I'd recommend you to use params.
Also, the ID for the players starts from 0, not 1. You also don't use the name at all so there's not point on getting the name and storing it to an array.
pawn Код:
if(sscanf(params,"s[128]", text)) return SendClientMessage(playerid, 0xFFFFFFF,"Comanda gresita. Corect: /r text pentru a transmite ceva colegilor de factiune");
Also, the ID for the players starts from 0, not 1. You also don't use the name at all so there's not point on getting the name and storing it to an array.
pawn Код:
dcmd_r(playerid, params[])
{
if(strcmp(factiune[playerid],"Medic",true) != 0) return SendClientMessage(playerid, 0xFF00FFFF , "Nu esti Medic sau Politist.");
if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFF,"Comanda gresita. Corect: /r text pentru a transmite ceva colegilor de factiune");
new strr[128];
format(strr,sizeof(strr),"Mesaj: \"%s\".", params);
for (new i; i != MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(!strcmp(factiune[i],"Medic",true)) SendClientMessage(i, 0xFF00FFFF , strr);
}
return 1;
}