need help to fix a error (+REP)
#1

hey i need to no how i fix the error code

Here is the errors
Код:
filterscripts\payday.pwn(144) : warning 215: expression has no effect
filterscripts\payday.pwn(144) : warning 215: expression has no effect
filterscripts\payday.pwn(144) : warning 215: expression has no effect
filterscripts\payday.pwn(144) : error 001: expected token: ";", but found ")"
filterscripts\payday.pwn(144) : error 029: invalid expression, assumed zero
filterscripts\payday.pwn(144) : error 029: invalid expression, assumed zero
filterscripts\payday.pwn(144) : fatal error 107: too many error messages on one line
and here is the line it is on

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        dcmd(setexp, 6, cmdtext);
        dcmd(giveexp, 7, cmdtext);
        dcmd(getexp, 6, cmdtext);
        dcmd(givelevel, 9, cmdtext);
        dcmd(getlevel, 8, cmdtext);
        dcmd(paydayall, 9, cmdtext);
        dcmd(getstatus, 9, cmdtext);
        return 0;
}
Reply
#2

Which line?
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
Which line?
dcmd(setexp, 6, cmdtext);
Reply
#4

I don't think you're looking in the correct file / line. Because the error is basically saying that there should be placed a ')' in that line somewhere but it has found a ';'.
Reply
#5

Quote:
Originally Posted by Berky
Посмотреть сообщение
I don't think you're looking in the correct file / line. Because the error is basically saying that there should be placed a ')' in that line somewhere but it has found a ';'.
i will upload the full pwn
Reply
#6

Код:
#include <a_samp>
#include <ldudb>
#include <lfuncs>

#define dcmd(%1,%2,%3) #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define Green 0x16EB43FF

enum PData
{
        EXP,
        Level
};
new PlayerInfo[MAX_PLAYERS][PData];
new file2[256];

forward Payday(playerid);

public OnFilterScriptInit()
{
        print("\n==========================================");
        print(" Exp and Level System by Xaviour212 Loaded");
        print("==========================================\n");
        for(new j = 0; j < MAX_PLAYERS; j++)
    {
        SetTimerEx("Payday",1*60*60*1000,true,"i",j);
        }
        return 1;
}

public OnFilterScriptExit()
{
        return 1;
}

public OnPlayerConnect(playerid)
{
        if(!dini_Exists(PFile(playerid)))
        {
            dini_Create(PFile(playerid));
            SetPlayerScore(playerid, GetPlayerLevel(playerid));
            GivePlayerLevel(playerid, 1);
        }
        else
        {
        SetPlayerScore(playerid, GetPlayerLevel(playerid));
        PlayerInfo[playerid][EXP] = GetPlayerExp(playerid);
        PlayerInfo[playerid][Level] = GetPlayerLevel(playerid);
        }
        return 0;
}

public OnPlayerDeath(playerid, killerid, reason)
{
        new string[256];
        new Xp = 5*GetPlayerLevel(killerid);
        GivePlayerExp(killerid, 200-Xp);
        format(string, sizeof(string), "You has killed {FF0000}%s {16EB43}and get a {FFFFFF}%d {16EB43}exp", Gn(playerid), 200-Xp);
        SendClientMessage(killerid, Green, string);
        return 1;
}

public Payday(playerid)
{
        new Bonus = 500*GetPlayerLevel(playerid);
        new string[50];
        GivePlayerMoney(playerid, 2500+Bonus);
        format(string, sizeof(string), "~w~PayDay! ~n~~g~$%d", 2500+Bonus);
        GameTextForPlayer(playerid, string, 3000, 1);
}

public OnPlayerUpdate(playerid)
{
        new string[256];
        SetPlayerScore(playerid, GetPlayerLevel(playerid));
        if(GetPlayerExp(playerid) >= 1000)
        {
            if(GetPlayerLevel(playerid) <= 40)
            {
                GivePlayerLevel(playerid, 1);
                format(string, sizeof(string), "Congratulations! Your level has been increased to {FFFFFF}%d", GetPlayerLevel(playerid));
                SendClientMessage(playerid, Green, string);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~w~Updating Score List...",3000,3);
                GivePlayerExp(playerid, - 1000);
                }
                else if(GetPlayerLevel(playerid) >= 40)
                {
                SetPlayerExp(playerid, 1000);
                SetPlayerLevel(playerid, 40);
                }
        }
        if(GetPlayerLevel(playerid) >= 40)
        {
        format(string, sizeof(string), "You have reached the maximum level", GetPlayerLevel(playerid));
        SendClientMessage(playerid, Green, string);
        }
        return 1;
}

SetPlayerExp(playerid, exp)
{
        dini_IntSet(PFile(playerid), "Exp", exp);
        PlayerInfo[playerid][EXP] = exp;
}

GivePlayerExp(playerid, exp)
{
    PlayerInfo[playerid][EXP] += exp;
    dini_IntSet(PFile(playerid), "Exp", PlayerInfo[playerid][EXP]);
}

SetPlayerLevel(playerid, level)
{
    PlayerInfo[playerid][Level] = level;
    dini_IntSet(PFile(playerid), "Level", PlayerInfo[playerid][Level]);
}

GivePlayerLevel(playerid, level)
{
    PlayerInfo[playerid][Level] += level;
    dini_IntSet(PFile(playerid), "Level", PlayerInfo[playerid][Level]);
}

stock GetPlayerExp(playerid) return dini_Int(PFile(playerid), "Exp");

stock GetPlayerLevel(playerid) return dini_Int(PFile(playerid), "Level");

stock Gn(playerid)
{
        new pname[24];
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        return pname;
}

stock PFile(playerid)
{
        format(file2,64,"/LuxAdmin/Accounts/%s.sav",Gn(playerid));
        return file2;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        dcmd(setexp, 6, cmdtext);
        dcmd(giveexp, 7, cmdtext);
        dcmd(getexp, 6, cmdtext);
        dcmd(givelevel, 9, cmdtext);
        dcmd(getlevel, 8, cmdtext);
        dcmd(paydayall, 9, cmdtext);
        dcmd(getstatus, 9, cmdtext);
        return 0;
}
dcmd_setexp(playerid, params[])// Set player exp
{
        new giveplayerid, amount;
        SendClientMessage(playerid, 0xFF0000AA, "{FF0000}[ERROR]{FFFFFF}Usage: /setexp [PlayerID] [Exp]");
        SetPlayerExp(playerid, amount);
        return 1;
}

dcmd_giveexp(playerid, params[])// Give player level
{
        new giveplayerid, amount;
        SendClientMessage(playerid, 0xFF0000AA, "{FF0000}[ERROR]{FFFFFF}Usage: /giveexp [PlayerID] [Exp]");
        GivePlayerExp(giveplayerid, amount);
        return 1;
}

dcmd_getexp(playerid, params[])//Get a player exp
{
        new giveplayerid, string[256];
        SendClientMessage(playerid, 0xFF0000AA, "{FF0000}[ERROR]{FFFFFF}Usage: /getexp [PlayerID]");
        format(string, sizeof(string), "{FF0000}%s{FFFFFF} having {A1CAF1}%d{FFFFFF} exp", Gn(giveplayerid), GetPlayerExp(giveplayerid));
        SendClientMessage(playerid, Green, string);
        return 1;
}

dcmd_givelevel(playerid, params[])//Give player level
{
        new giveplayerid, amount;
        SendClientMessage(playerid, 0xFF0000AA, "{FF0000}[ERROR]{FFFFFF}Usage: /givelevel [PlayerID] [Level]");
        GivePlayerLevel(giveplayerid, amount);
        return 1;
}

dcmd_getlevel(playerid, params[])//Get player level
{
        new giveplayerid, string[256];
        SendClientMessage(playerid, 0xFF0000AA, "{FF0000}[ERROR]{FFFFFF}Usage: /getlevel [PlayerID]");
        format(string, sizeof(string), "{FF0000}%s{FFFFFF} is a level{A1CAF1}%d{FFFFFF}.", Gn(giveplayerid), GetPlayerLevel(giveplayerid));
        SendClientMessage(playerid, Green, string);
        return 1;
}

dcmd_paydayall(playerid, params[])//Payday for all player
{
        #pragma unused params
        #pragma unused playerid
        for(new j = 0; j < MAX_PLAYERS; j++)
    {
        Payday(j);
        }
        return 1;
}

dcmd_getstatus(playerid, params[])//Get player status
{
        new giveplayerid, string[256];
        new Bonus = 500*GetPlayerLevel(giveplayerid);
        SendClientMessage(playerid, 0xFF0000AA, "{FF0000}[ERROR]{FFFFFF}Usage: /getstatus [PlayerID]");
        format(string, sizeof(string), "{446CCF}Name{FFFFFF}: %s \n{FF0000}Exp{FFFFFF}: %d \n{A1CAF1}Level{FFFFFF}: %d \n{00FF00}Payday{FFFFFF}: %d", Gn(giveplayerid), GetPlayerExp(giveplayerid), GetPlayerLevel(playerid), 2500+Bonus);
        SendClientMessage(playerid, Green, string);
        return 1;
}
Reply
#7

http://pastebin.com/nMfjYUmE (Expires in 1 hour and is private)

I have fixed everything, but you got some warnings, I couldn't fix those because I don't have your includes. You used #pragma unused playerid, which caused the error with the ')'. You also should use sscanf2 in your includes. Also I have noticed that you just started with this project and I actually recommend you to use ZCMD because it's much faster than dcmd.
Reply
#8

Quote:
Originally Posted by Berky
Посмотреть сообщение
http://pastebin.com/nMfjYUmE (Expires in 1 hour and is private)

I have fixed everything, but you got some warnings, I couldn't fix those because I don't have your includes. You used #pragma unused playerid, which caused the error with the ')'. You also should use sscanf2 in your includes. Also I have noticed that you just started with this project and I actually recommend you to use ZCMD because it's much faster than dcmd.
hey i missed the link sorry can you reupload please
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)