didn't work but compiling
#1

hello all, any thing is wrong here??
it compile good but didn't work in the game.
pawn Код:
CMD:pedit(playerid, params[])
{
    new String[128],
        time,
        Float:x,
        Float:y,
        Float:z,
        name,
        point,
        profit;
        point = idx;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
    if(sscanf(params, "s[32]", params))
    {
        SendClientMessage(playerid, 0xFF0000AA, "[Usage]:{FFFFFF} /pedit [option]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: location | time | name | profit");
        return 1;
    }

    if(!strcmp(params, "location", true))
    {
        if(sscanf(params, "s[32]i", params, point)) return SendClientMessage(playerid, 0xFF0000AA, "[Usage]:{FFFFFF} /pedit location [pointid]");
        if(point < 0 || point > 5) return SendClientMessage(playerid, COLOR_GREY, "Points are between 0 and 5.");
        GetPlayerPos(playerid,x,y,z);
        DestroyDynamic3DTextLabel(PointInfo[point][pText]);
        DestroyPickup(PointInfo[point][pPickup]);
        PointInfo[point][pX] = x;
        PointInfo[point][pY] = y;
        PointInfo[point][pZ] = z;
        format(String, sizeof(String),"Point name: %s\nCapture Time: %d\nOwner: %s\nProfit: %d\n Type /capture to attempet to capture it.",RPON(point),PointInfo[point][pTime],RFaN(PointInfo[point][pOwner]),PointInfo[point][pProfit]);
        PointInfo[point][pText] = CreateDynamic3DTextLabel(String, COLOR_YELLOW, PointInfo[point][pX], PointInfo[point][pY], PointInfo[point][pZ], 15);
        PointInfo[point][pPickup] = CreatePickup(1274, 1, PointInfo[point][pX], PointInfo[point][pY], PointInfo[point][pZ], 0);
        format(String, sizeof(String)," You have set the point %s id coordinates in your position",RPON(point));
        SendClientMessage(playerid, COLOR_LIGHTBLUE, String);
        format(String, sizeof(String), "AdmWarn: %s has changed the %s point position.", RPN(playerid), PointInfo[point][pName]);
        SendAdminMessage(COLOR_DARKRED, 1, String);
        return 1;
    }
    if(!strcmp(params, "time", true))
    {
        if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
        if(sscanf(params, "s[32]ii", params, point, time)) return SendClientMessage(playerid, 0xFF0000AA, "[Usage]:{FFFFFF} /pedit time [pointid] [timeid]");
        if(point < 0 || point > 5) return SendClientMessage(playerid, COLOR_GREY, "Points are between 0 and 5.");
        if(time < 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid time.");
        DestroyDynamic3DTextLabel(PointInfo[point][pText]);
        PointInfo[point][pTime] = time;
        format(String, sizeof(String),"Point name: %s\nCapture Time: %d Hours\nOwner: %s\nProfit: %d\n Type /capture to attempet to capture it.",RPON(point),PointInfo[point][pTime],RFaN(PointInfo[point][pOwner]),PointInfo[point][pProfit]);
        PointInfo[point][pText] = CreateDynamic3DTextLabel(String, COLOR_YELLOW, PointInfo[point][pX], PointInfo[point][pY], PointInfo[point][pZ]+5, 5);
        format(String, sizeof(String), "AdmWarn: %s has set the %s point to be capturable in %d hours.", RPN(playerid), PointInfo[point][pName], PointInfo[point][pTime]);
        SendAdminMessage(COLOR_DARKRED, 1, String);
        return 1;
    }
    if(!strcmp(params, "name", true))
    {
        if(sscanf(params, "s[32]is[32]", params, point, name)) return SendClientMessage(playerid, 0xFF0000AA, "[Usage]:{FFFFFF} /pedit name [pointid] [name]");
        if(point < 0 || point > 5) return SendClientMessage(playerid, COLOR_GREY, "Points are between 0 and 5.");
        format(String, sizeof(String), "AdmWarn: %s has changed %s point name to %s", RPN(playerid), RPON(point), name);
        SendAdminMessage(COLOR_DARKRED, 1, String);
        DestroyDynamic3DTextLabel(PointInfo[point][pText]);
        format(PointInfo[point][pName], 32, "%s", name);
        format(String, sizeof(String),"Point name: %s\nCapture Time: %d Hours\nOwner: %s\nProfit: %d\n Type /capture to attempet to capture it.",RPON(point),PointInfo[point][pTime],RFaN(PointInfo[point][pOwner]),PointInfo[point][pProfit]);
        PointInfo[point][pText] = CreateDynamic3DTextLabel(String, COLOR_YELLOW, PointInfo[point][pX], PointInfo[point][pY], PointInfo[point][pZ]+5, 5);
        return 1;
    }
    if(!strcmp(params, "profit", true))
    {
        if(sscanf(params, "s[32]ii", params, point, profit)) return SendClientMessage(playerid, 0xFF0000AA, "[Usage]:{FFFFFF} /pedit profit [pointid] [amount]");
        if(point < 0 || point > 5) return SendClientMessage(playerid, COLOR_GREY, "Points are between 1 and 6.");
        DestroyDynamic3DTextLabel(PointInfo[point][pText]);
        PointInfo[point][pProfit] = profit;
        format(String, sizeof(String), "AdmWarn: %s has changed %s point profit to %d$", RPN(playerid), PointInfo[point][pName], PointInfo[point][pProfit]);
        SendAdminMessage(COLOR_DARKRED, 1, String);
        format(String, sizeof(String),"Point name: %s\nCapture Time: %d Hours\nOwner: %s\nProfit: %d\n Type /capture to attempet to capture it.",RPON(point),PointInfo[point][pTime],RFaN(PointInfo[point][pOwner]),PointInfo[point][pProfit]);
        PointInfo[point][pText] = CreateDynamic3DTextLabel(String, COLOR_YELLOW, PointInfo[point][pX], PointInfo[point][pY], PointInfo[point][pZ]+5, 5);
        return 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)