SA-MP Forums Archive
Help me command bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me command bug (/showthread.php?tid=584461)



Help me command bug - CZ - 04.08.2015

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;
    }



Re: Help me command bug - Crayder - 05.08.2015

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.