Team Chat Help (STRCMP To ZCMD)
#1

Ok ive tried everything and just cant do it can someone help me convert this completely into ZCMD the
Код:
cmdtext
is the problem and im not fimiliar with params

Code:

pawn Код:
CMD:t1(playerid, params[])
{
    if(gTeam[playerid] == CLASS_TEAM1)
    {
        new output[100];
        new string[100];
        new pname[24];

        if(!cmdtext[3]) return SendClientMessage(playerid, 0x0, "USAGE: /t1 [msg]");
        GetPlayerName(playerid, pname, 24);
        strmid(output,cmdtext,3,strlen(cmdtext));
        format(string, sizeof(string), "%s [%d]: %s",pname,playerid,output);
        printf("%s", string);
        for(new i=0;i<MAX_PLAYERS;i++)
        {
        if(gTeam[i] == CLASS_TEAM1)
        {
        format(string, sizeof(string), "%s [%d]: %s",pname,playerid,output);
        TeamRadio(0x0,string);
        }
      }
    }
    else
    {
        SendClientMessage(playerid, 0x0, "Only Team1 Can Use This Radio Frequency!");
    }
    return true;
}
Thanks in advanced
Reply
#2

Use sscanf.
https://sampwiki.blast.hk/wiki/Fast_Commands#sscanf
sscanf + zcmd = Effective and easy.
i'm still using dcmd coz on some reason i dont like zcmd even though its better.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)