Not working right.
#2

Try now:
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif
enum pInfo{
    leveldata,
    score,
    pScore
}
new PlayerInfo[MAX_PLAYERS][pInfo];
forward Update();
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    SetTimer("Update", 10000, true);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/levelhelp", cmdtext, true, 10) == 0)
    {
        new str[20]; //no needed 512, in this case probably 20 cells is ok.
        fromat(str,20,"%d/9",PlayerInfo[playerid][leveldata]);
        SendClientMessage(playerid,-1,str);
        //---
        format(str, 20, "Level: %d",GetPlayerScore(playerid)); //Try observe the difference.
        SendClientMessage(playerid,-1,str);
        //If you want make a command list for each level do this:
        switch(PlayerInfo[playerid][leveldata])
        {
            case 0: //Level 0
            {
                SendClientMessage(playerid,-1,"You're level 0...");
            }
            case 1: //Level 1
            {
                SendClientMessage(playerid,-1,"You're level 1!");
            }
        }
        return 1;
    }
    return 0;
}

public Update()
{
     for(new i=0; i <= MAX_PLAYERS; i++);
     {
           PlayerInfo[i][leveldata] += 1;
           if(PlayerInfo[i][leveldata] == 9)
           {
                 PlayerInfo[i][score] += 1;
                 SetPlayerScore(i, PlayerInfo[i][score]);
           }
      }
}
Reply


Messages In This Thread
Not working right. - by TaLhA XIV - 07.08.2012, 23:39
Respuesta: Not working right. - by [DOG]irinel1996 - 07.08.2012, 23:48
Re: Not working right. - by Jstylezzz - 07.08.2012, 23:49
Re: Not working right. - by TaLhA XIV - 07.08.2012, 23:50
Re: Not working right. - by Magic_Time - 07.08.2012, 23:54
Re: Not working right. - by TaLhA XIV - 07.08.2012, 23:57
Re: Not working right. - by Jstylezzz - 07.08.2012, 23:58
Re: Not working right. - by Magic_Time - 07.08.2012, 23:58
Re: Not working right. - by Magic_Time - 08.08.2012, 00:03
Re: Not working right. - by TaLhA XIV - 08.08.2012, 00:04

Forum Jump:


Users browsing this thread: 1 Guest(s)