dmcd sscanf comand problem
#2

You'll need to add the size to the "s" specifier. For example:

pawn Код:
if(sscanf(params,"s[128]", text)) return SendClientMessage(playerid, 0xFFFFFFF,"Comanda gresita. Corect: /r text pentru a transmite ceva colegilor de factiune");
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 Код:
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;
}
Reply


Messages In This Thread
dmcd sscanf comand problem - by moof2010 - 29.11.2013, 13:05
Re: dmcd sscanf comand problem - by Konstantinos - 29.11.2013, 13:24
Re: dmcd sscanf comand problem - by moof2010 - 29.11.2013, 13:34

Forum Jump:


Users browsing this thread: 2 Guest(s)