All commands in server stopped working
#1

Hi,

So I'm making a new gamemode from scratch. Now I followed a tutorial (https://sampforum.blast.hk/showthread.php?tid=377207) on the forums and tried to convert a command to dcmd. When I started the server up, most of the commands are not working anymore.

This is the code:

Код:
dcmd_buylevel(playerid,params[])
{
		#pragma unused params
		new string[30]; // String.
        if(IsPlayerConnected(playerid) == 1) // Checks if player is connected.
        {
            new points[248]; // Points.
            new nxtlevel = AccInfo[playerid][pLevel]+1; // As soon as its executed, It adds +1 to your score.
            new expamount = nxtlevel*levelexp; // Exp amount, Its 2 CURRENTLY but you can raise it by adding +number after levelexp
            if(AccInfo[playerid][Exp] < expamount) // Checks if player's exp amount is above the required one or not.
            {
                format(points,sizeof(points)," You need [%d] Exp Points in order to level up, You currently have [%d]",expamount,AccInfo[playerid][Exp]); // Format, This is pretty obvious.
                SendClientMessage(playerid,LIME,points); // Sends the message.
                return 1;
            }
            else
            {
                AccInfo[playerid][Exp] = 0; //  Sets the EXP amount to 0 as you level'd up.
                AccInfo[playerid][pLevel]++; // Adds a level.
                format(string,sizeof(string),"~g~Your now level:[%d]",AccInfo[playerid][pLevel]); // Format.
                GameTextForPlayer(playerid,string,6000,1); // Sends gametext about his new level'ing up.
                return 1;
            }
        }
        return 1;
}
Could anyone please explain what exactly went wrong? I'm new to scripting and I wish to learn it, but it's hard to do it all on my own hehe.
Reply


Messages In This Thread
All commands in server stopped working - by DaRoderick - 25.11.2012, 21:03
Re: All commands in server stopped working - by SuperViper - 25.11.2012, 21:30
Re: All commands in server stopped working - by DaRoderick - 25.11.2012, 21:35
Re: All commands in server stopped working - by DaRoderick - 25.11.2012, 23:04
Re: All commands in server stopped working - by Joe Staff - 26.11.2012, 02:10
Re: All commands in server stopped working - by DaRoderick - 26.11.2012, 08:50
Re: All commands in server stopped working - by cosbraa - 26.11.2012, 08:59
Re: All commands in server stopped working - by DaRoderick - 26.11.2012, 09:10

Forum Jump:


Users browsing this thread: 1 Guest(s)