Jump to content

Akan

Membru
  • Posts

    75
  • Joined

  • Days Won

    6

Posts posted by Akan

  1. ShowRenters(playerid) {
    	new sQuery[256], string[180], MemberString[1024], szResult[180];
    	new name[180], TitleString[180], tmembers, onmembers;
    	format(sQuery, sizeof(sQuery), "SELECT * FROM `users` WHERE `Rented` = %d LIMIT 50", PlayerInfo[playerid][pHouse]);
    	new Cache: result = mysql_query(SQL, sQuery);
    	for(new i, j = cache_get_row_count(); i != j; ++i)
    	{
    		cache_get_field_content(i, "name", szResult); format(name, 256, szResult);
    		new userID = GetPlayerID(name);
    		if(userID != INVALID_PLAYER_ID) {
    			onmembers++;
    			format(string, sizeof(string), "%d. %s (%d) (Online)\n", tmembers+1, name, userID);
    			strcat(MemberString, string, sizeof(MemberString));
    		}
    		else {
    			format(string, sizeof(string), "%d. %s (Offline)\n", tmembers+1, name);
    			strcat(MemberString, string, sizeof(MemberString));
    		}
    		tmembers++;
    	}
    	cache_delete(result);
    	format(TitleString, sizeof(TitleString), "Chiriasi (%d/%d)", onmembers, tmembers);
    	ShowPlayerDialog(playerid, DIALOG_RENTERS, DIALOG_STYLE_LIST, TitleString, MemberString, "OK", "Close");
    	return 1;
    }


    Eu asa am functia.
    Daca nu ai `Rented` in `users`, poti inlocui cum ai tu, adica in loc de `Rented` inlocuiesti cu `House`
     

    stock GetPlayerID(playerName[]) {
      	foreach(new i: Player) {
        	if(IsPlayerLogged[i] == 1) {
          		if(strcmp(PlayerInfo[i][pUsername], playerName, true) == 0) return i;
        	}
      	}
      	return INVALID_PLAYER_ID;
    }

    Ti-am lasat aici si functia GetPlayerID in caz ca nu o ai.

  2. Cauta aceasta linie in comanda /fpk:
     

    PlayerInfo[id][pChar] = 0;

    Zero este id-ul skin-ului CJ, pui in loc de 0 ce skin vrei sa-i seteze cand ia fpk, sau daca vrei sa ramana cu skin-ul pe care il avea cand a primit /fpk, pur si simplu stergi toata linia.

  3. format(query, sizeof(query), "UPDATE users SET Pin = %i WHERE `ID` = %i", pin, playerVariables[playerid][pSQLID]);

    Pune direct asa in locul acelui query al tau de la dialog_setpin.

     

    Din mysql_log pe care l-ai trimis se vede ca nu ai inlocuit cum ti-am zis...
    `Pin' - asta e gresit, ai ` inainte de Pin si ' dupa Pin ... 2 semne de punctuatie diferite... sterge-le pe amandoua, pune cum ti-am scris eu mai sus codul ca nu sunt necesare semnele de punctuatie in cazul de fata!

    • Upvote 1
  4. Cu multa placere. :)

     

    #define FILTERSCRIPT
    
    #include <a_samp>
    
    #if defined FILTERSCRIPT
    
    #define BackTime 12000 // Timpul in care liftul revine la pozitia initiala
    
    new pdlift[2];
    
    forward PdLift1();
    forward PdLift2();
    forward IsACop(playerid);
    forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
    
    public OnFilterScriptInit()
    {
        //////////////////////////////////////////////////////////////////////////
    
        //////////aici se pune exteriorul ////////
    
        //////////////////////////////////////////////////////////////////////////
    
    
        pdlift[0] = CreateObject(19359, 2089.24634, 2361.20728, 10.20070,   0.00000, -90.00000, 0.00000); ///// liftul 1
        pdlift[1] = CreateObject(19359, 2197.13550, 2396.73804, 10.45930,   0.00000, -90.00000, -90.00000); ///// liftul 2
    
    
        print("\n--------------------------------------");
        print("        Flashhiee");
        print("--------------------------------------\n");
        return 1;
    }
    
    public OnFilterScriptExit()
    {
        return 1;
    }
    
    public OnPlayerCommandText(playerid, cmdtext[])
    {
        if (strcmp("/lift", cmdtext, true, 10) == 0) {
            if(PlayerToPoint(5.0,playerid,2089.24634, 2361.20728, 10.20070) || PlayerToPoint(5.0,playerid,2089.24634, 2361.20728, 22.48570)) { /// sus/jos (lift 1)
                if(!IsObjectMoving(pdlift[0])) {
                    MoveObject(pdlift[0],2089.24634, 2361.20728, 22.48570,1.5); //// jos (lift 1)
                    SetTimer("PdLift1",BackTime,false); } else {
                    SendClientMessage(playerid,-1,"Lift is already used."); }
            } else if(PlayerToPoint(5.0,playerid,2197.13550, 2396.73804, 10.45930) || PlayerToPoint(5.0,playerid,2197.13550, 2396.73804, 22.55330)) { /// sus/jos (lift 2)
                if(!IsObjectMoving(pdlift[1])) {
                    MoveObject(pdlift[1],2197.13550, 2396.73804, 22.55330,1.5); //// jos (lift 2)
                    SetTimer("PdLift2",BackTime,false); } else {
                    SendClientMessage(playerid,-1,"Lift is already used."); }
            } else {
                SendClientMessage(playerid,-1,"You must be close to lift."); }
           	return 1;
        }
        return 0;
    }
    
    public PdLift1() return MoveObject(pdlift[0],2089.24634, 2361.20728, 10.20070,1.5); //// sus (lift 1)
    
    public PdLift2() return MoveObject(pdlift[1],2197.13550, 2396.73804, 10.45930,1.5); //// sus (lift 2)
    
    public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
    {
        if(IsPlayerConnected(playerid))
        {
            new Float:oldposx, Float:oldposy, Float:oldposz;
            new Float:tempposx, Float:tempposy, Float:tempposz;
            GetPlayerPos(playerid, oldposx, oldposy, oldposz);
            tempposx = (oldposx -x);
            tempposy = (oldposy -y);
            tempposz = (oldposz -z);
            if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
            {
                return 1;
            }
        }
        return 0;
    }
    
    #endif
    #define BackTime 12000 // Timpul in care liftul revine la pozitia initiala

    Poftim! Bafta!

×
×
  • 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.