Help me command bug
#1

Someone help me take this command to strcmp I tried to change so he only speaks / iniciarcorrida [Name] and not out of it

pawn Код:
CMD:startrace(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "<!> You are not an administrator!");
    if(AutomaticRace == true) return SendClientMessage(playerid, RED, "<!> Not possible. Automatic race is enabled!");
    if(BuildRace != 0) return SendClientMessage(playerid, RED, "<!> There's someone building a race!");
    if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> There's a race currently. Wait first till race ends!");
    if(isnull(params)) return SendClientMessage(playerid, RED, "<!> /startrace [racename]");
    LoadRace(playerid, params);
    return 1;
}
pawn Код:
if(strcmp(cmd, "/startrace", true) == 0)
    {
    tmp = strtok(cmdtext, idx);
    if(CallRemoteFunction("GetPlayerAdminLevel","i",playerid) < 1) return SendClientMessage(playerid,0x66CCFFAA,StringTable[8]);
    if(BuildRace != 0) return SendClientMessage(playerid, RED, "Nгo й possнvel. Corrida automбtica estб ativada!");
    if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "Hб alguйm a construзгo de uma corrida!");
    if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Use /Iniciarcorrida [Nome-Da-Corrida]");
    LoadRace(playerid, cmd);
    return 1;
    }
Reply
#2

Wait, why are you trying to switch TO strcmp for a command processor? If you're using ZCMD, stick with ZCMD; it is far better than strcmp.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)