help in strcmp command
#1

i had a gate script but its not working in my server. so i decided to use a gate system fs so my gamemode uses default command that is strcmp so this fs is in zcmd


so i need to convert this to strmp

Код:
CMD:gate(playerid, params[])
{
    //  Gates
    new done;
    for(new idx=1; idx<MAX_GATES; idx++)
    {
        new Float:cur[3];
        if(GateInfo[idx][gModel])
        {
            GetDynamicObjectPos(GateInfo[idx][gGate], cur[0], cur[1], cur[2]);
            if(IsPlayerInRangeOfPoint(playerid, 8, cur[0], cur[1], cur[2]) || IsPlayerInRangeOfPoint(playerid, 8, GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ]) || IsPlayerInRangeOfPoint(playerid, 8, GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ]))
            {
                if(strlen(GateInfo[idx][gPassword]))
                {
                    if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE: /gate [password]");
                    if(strcmp(params, GateInfo[idx][gPassword])) return SendClientMessage(playerid, -1, "Invalid gate password.");
                    if(!GateInfo[idx][gStatus])
                    {
                        GateInfo[idx][gStatus] = 1;
                        MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ], GateInfo[idx][gSpeed], GateInfo[idx][gORX], GateInfo[idx][gORY], GateInfo[idx][gORZ]);
                        done=1;
                        break;
                    }
                    else
                    {
                        GateInfo[idx][gStatus] = 0;
                        MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gSpeed], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]);
                        done=1;
                        break;
                    }
                }
                else
                {
                    if(!GateInfo[idx][gStatus])
                    {
                        GateInfo[idx][gStatus] = 1;
                        MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ], GateInfo[idx][gSpeed], GateInfo[idx][gORX], GateInfo[idx][gORY], GateInfo[idx][gORZ]);
                        done=1;
                        break;
                    }
                    else
                    {
                        GateInfo[idx][gStatus] = 0;
                        MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gSpeed], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]);
                        done=1;
                        break;
                    }
                }
            }
        }
    }
    if(!done) SendClientMessage(playerid, -1, "You aren't near a gate you can open.");
    return 1;
}
Reply


Messages In This Thread
help in strcmp command - by bugmenotlol - 31.10.2016, 13:39
Re: help in strcmp command - by bugmenotlol - 31.10.2016, 13:41
Re: help in strcmp command - by Threshold - 31.10.2016, 13:41
Re: help in strcmp command - by bugmenotlol - 31.10.2016, 13:45
Re: help in strcmp command - by Threshold - 31.10.2016, 14:03
Re: help in strcmp command - by bugmenotlol - 31.10.2016, 15:46
Re: help in strcmp command - by bugmenotlol - 31.10.2016, 16:32
Re: help in strcmp command - by Threshold - 31.10.2016, 16:32
Re: help in strcmp command - by bugmenotlol - 31.10.2016, 16:38
Re: help in strcmp command - by Threshold - 31.10.2016, 16:45

Forum Jump:


Users browsing this thread: 2 Guest(s)