Jump to content

namexd

Membru
  • Posts

    5
  • Joined

  • Last visited

Posts posted by namexd

  1. Acum 1 oră, Mento a spus:

    Daca vrei sa faci un astfel de sistem, trebuie sa te gandesti cam cum sa urce interdictia, de exemplu:

     faci un define cu Restrictie care sa aiba valoarea 2. Pentru buylevel faci mereu verificare daca PlayerInfo[playerid][pTime] (sau cum ai tu declarate orele) si pui sa fie mai mare sau egal cu  PlayerInfo[playerid][pLevel] * Restrictie.

     de exemplu daca are nivel 3, pentru buylevel trebuie sa aibe 6 ore si tot asa..

    si verificarea o fac unde mai exact?

    dupa asta?

    if(PlayerInfo[playerid][pLevel] == 1 || PlayerInfo[playerid][pLevel] == 2 || PlayerInfo[playerid][pLevel] == 3 || PlayerInfo[playerid][pLevel] == 4)
    		{
    		    expamount = nxtlevel*2;
    		    costlevel = nxtlevel*4000;
    		}
    		else if(PlayerInfo[playerid][pLevel] >= 5)
    		{
    		    expamount = nxtlevel*levelexp;
    		    costlevel = nxtlevel*levelcost;
    		

    sau inainte? 

  2. Acum 2 minute, Florinst56 a spus:

    PunE aici comanda 

    CMD:buylevel(playerid,params[])
    {
    	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
        if(IsPlayerConnected(playerid))
        {
            new nxtlevel = PlayerInfo[playerid][pLevel];
    		new costlevel;
    		new expamount,string[128],sendername[30];
    		if(PlayerInfo[playerid][pLevel] == 1 || PlayerInfo[playerid][pLevel] == 2 || PlayerInfo[playerid][pLevel] == 3 || PlayerInfo[playerid][pLevel] == 4)
    		{
    		    expamount = nxtlevel*2;
    		    costlevel = nxtlevel*4000;
    		}
    		else if(PlayerInfo[playerid][pLevel] >= 5)
    		{
    		    expamount = nxtlevel*levelexp;
    		    costlevel = nxtlevel*levelcost;
    		}
    		if (gPlayerLogged[playerid] != 0)
    		{
    		    GetPlayerName(playerid,sendername,sizeof(sendername));
    			if(GetPlayerCash(playerid) < costlevel) return SCM(playerid,COLOR_GRAD1,"You do not have enough cash.");
    			if(PlayerInfo[playerid][pExp] < expamount) return SCM(playerid,COLOR_GRAD1,"You do not have the necessary number of respect points.");
    			GivePlayerCash(playerid, -costlevel);
    			PlayerInfo[playerid][pLevel]++;
    		    PlayerInfo[playerid][pExp] -= expamount;
    		    format(string,sizeof(string),"{3A8EBA}Felicitari, acum ai level %d!",PlayerInfo[playerid][pLevel]);
    			SCM(playerid,COLOR_WHITE,string);
    			format(string, sizeof(string), "* %s are acum level %d.",sendername,PlayerInfo[playerid][pLevel]);
    			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    			new var100[256],y,m,d,h,mi,s,string2[256],string3[256];
    			getdate(y,m,d);
    			gettime(h,mi,s);
    			format(string2,sizeof(string2),"[%02d-%02d-%d %02d:%02d:%02d] %s[user:%d] used /buylevel and now have level %d.",d,m,y,h,mi,s,sendername,PlayerInfo[playerid][pSQLID],PlayerInfo[playerid][pLevel]);
    			mysql_real_escape_string(string2, string3);
    			mysql_format(SQL, var100, sizeof(var100), "INSERT INTO playerlogs (`playerid`,`giverid`,`action`,`time`) VALUES ('%d','0','%s','%02d-%02d-%d %02d:%02d:%02d')", PlayerInfo[playerid][pSQLID],string3,d,m,y,h,mi,s);
    			mysql_tquery(SQL,var100,"","");
    		    new total = PlayerInfo[playerid][pExp];
    		    if(total > 0)
    		    {
    		        PlayerInfo[playerid][pExp] = total;
    		    }
    		    else
    		    {
    		        PlayerInfo[playerid][pExp] = 0;
    		    }
    		    Update(playerid,pCashx);
    		    Update(playerid,pRP);
    			Update(playerid,pLevelx);
    			SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
    			UpdateProgressBar(playerid);
    		}
    		else return SendClientMessage(playerid, COLOR_WHITE,"{FFB870}You are not logged in.");
    	}
    	return 1;
    }

     

  3. Acum 3 ore, Depressive_ a spus:

    Nu-ti da nimeni mură-n gura.

    Creezi comanda,iar daca primesti erori sau nu se executa cum trebuie postezi codul sau erorile intr-un topic nou in ajutor scripting.

    Comanda de /buylevel este facuta dar nu stiu sa fac sa poti cumpara level pe ore jucate..

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.