Jump to content

Mark.W

Membru
  • Posts

    30
  • Joined

  • Last visited

    Never

Posts posted by Mark.W

  1. Salut. Probabil ca este tarziu si nu-mi dau seama sau nu stiu cum sa o fac sa mearga. Ori chiar amandoua. Cert este ca am o problema cu salvarea datelor jucatorului la deconectare si va cer ajutorul.

    La OnPlayerDisconnect am asa:

    public OnPlayerDisconnect(playerid, reason)
    {
    	new Float:x, Float:y, Float:z, Float:rot;
    	GetPlayerPos(playerid, Float:x, Float:y, Float:z);
    	GetPlayerFacingAngle(playerid, Float:rot);
    	SetPVarFloat(playerid, "Money", GetPlayerMoney(playerid));
    	if(reason == 0)
    	{
    		SetPVarFloat(playerid, "loc_X", Float:x);
    		SetPVarFloat(playerid, "loc_Y", Float:y);
    		SetPVarFloat(playerid, "loc_Z", Float:z);
    		SetPVarFloat(playerid, "loc_angle", Float:rot);
    		return 1;
    	}
    	else
    	{
    	    if(GetPVarInt(playerid, "last_pos_spawn" )== 1)
    	    {
    			SetPVarFloat(playerid, "loc_X", Float:x);
    			SetPVarFloat(playerid, "loc_Y", Float:y);
    			SetPVarFloat(playerid, "loc_Z", Float:z);
    			SetPVarFloat(playerid, "loc_angle", Float:rot);
    			return 1;
    		}
    		else if(GetPVarInt(playerid, "has_rented_h") == 0)
    		{
    			SetPVarFloat(playerid, "loc_X", Float:x);
    			SetPVarFloat(playerid, "loc_Y", Float:y);
    			SetPVarFloat(playerid, "loc_Z", Float:z);
    			SetPVarFloat(playerid, "loc_angle", Float:rot);
    			return 1;
    		}
    	}
    	// save data - !!!!! MUST BE LAST ONE !!!!!
    	SavePlayerData(playerid);
    	return 1;
    }
    
    Iar functia SavePlayerData(playerid) este asa:
    public SavePlayerData(playerid)
    {
    	new pName[MAX_PLAYER_NAME], file[128], inventory[128];
    	GetPlayerName(playerid, pName, sizeof(pName));
    	format(file, sizeof(file), "/Accounts/%s.ini", pName);
    	format(inventory, sizeof(inventory), "/Accounts/%s_inv.ini", pName);
    	// stats
    	dini_IntSet(file, "XP", GetPVarInt(playerid, "XP"));
    	dini_FloatSet(file, "Money", GetPVarFloat(playerid, "Money"));
    	dini_FloatSet(file, "BankAcc", GetPVarFloat(playerid, "BankAcc"));
    	dini_IntSet(file, "Level", GetPVarInt(playerid, "Level"));
    	dini_IntSet(file, "AdminLevel", GetPVarInt(playerid, "AdminLevel"));
    	dini_Set(file, "Name", pName);
    	// password doesn`t save!
    	dini_FloatSet(file, "loc_X", GetPVarFloat(playerid, "loc_X"));
    	dini_FloatSet(file, "loc_Y", GetPVarFloat(playerid, "loc_Y"));
    	dini_FloatSet(file, "loc_Z", GetPVarFloat(playerid, "loc_Z"));
    	dini_FloatSet(file, "loc_angle", GetPVarFloat(playerid, "loc_angle"));
    	dini_IntSet(file, "ooc_status", GetPVarInt(playerid, "ooc_status"));
    	dini_IntSet(file, "pm_status", GetPVarInt(playerid, "pm_status"));
    	dini_IntSet(file, "Phone_#", GetPVarInt(playerid, "Phone_#"));
    	dini_IntSet(file, "Phone_Credit", GetPVarInt(playerid, "Phone_Credit"));
    	dini_IntSet(file, "has_rented_h", GetPVarInt(playerid, "has_rented_h"));
    	dini_IntSet(file, "last_pos_spawn", GetPVarInt(playerid, "last_pos_spawn"));
    				// inventory
    	GetPVarString(playerid, "item_1", InvItem1, sizeof(InvItem1));
    	GetPVarString(playerid, "item_2", InvItem2, sizeof(InvItem2));
    	GetPVarString(playerid, "item_3", InvItem3, sizeof(InvItem3));
    	GetPVarString(playerid, "item_4", InvItem4, sizeof(InvItem4));
    	GetPVarString(playerid, "item_5", InvItem5, sizeof(InvItem5));
    	GetPVarString(playerid, "item_6", InvItem6, sizeof(InvItem6));
    	GetPVarString(playerid, "item_7", InvItem7, sizeof(InvItem7));
    	GetPVarString(playerid, "item_8", InvItem8, sizeof(InvItem8));
    	GetPVarString(playerid, "item_9", InvItem9, sizeof(InvItem9));
    	GetPVarString(playerid, "item_10", InvItem10, sizeof(InvItem10));
    	dini_Set(inventory, "item_1", InvItem1);
    	dini_Set(inventory, "item_2", InvItem2);
    	dini_Set(inventory, "item_3", InvItem3);
    	dini_Set(inventory, "item_4", InvItem4);
    	dini_Set(inventory, "item_5", InvItem5);
    	dini_Set(inventory, "item_6", InvItem6);
    	dini_Set(inventory, "item_7", InvItem7);
    	dini_Set(inventory, "item_8", InvItem8);
    	dini_Set(inventory, "item_9", InvItem9);
    	dini_Set(inventory, "item_10", InvItem10);
    	return 1;
    }
    

    Nu stiu ce are de nu merge dar pe mine pur si simplu ma depaseste. Poate voi aveti ceva mai mult noroc. Multzam.

  2. Pai, normal ca la new cmds nu apare pentru ca trebuie sa adaugi tu. Eu nu am de unde sa stiu exact ce variable le ai definite si care nu. Am descarcat de pe net LAdmin 2.2 si m-am uitat pe acolo. Am presupus ca stii si tu sa rezolvi variabilele lipsa.

  3. Uite aici. Daca are ceva erori fa un reply cu ele ca nu am testat comanda.

    if(strcmp(cmd, "/vips", true) == 0)
    {
    	new cout=0;
    	SendClientMessage(playerid, green, "________________________________________");
    	for(new i=0; i<MAX_PLAYER; i++)
    	{
    	    if(IsPlayerConnected(i))
    	    {
    			GetPlayerName(i, adminname, sizeof(adminname));
    			format(string, 256, "VIP: %s [ID %d]", adminname,i);
    			count++;
    		}
    	}
    	if(count == 0) SendClientMessage(playerid, blue, "Found no VIP`s online");
    	SendClientMessage(playerid, green, "________________________________________");
        return 1;
    }
    

  4. Nice. Original. Nu am mai vazut pana acum. Si totusi, ce aveti toti cu acei stalpi de iluminat? In harta asta se potrivesc.....dar am vazut unele (nu de la tine) in care ... chiar nu isi au rostul stalpii de genul asta  ???

  5. Las Venturas Docks

    • English: It is a map that I have made about half year ago for a server. Then we changed from Las Venturas to San Fierro, so I decided to publish the map. I personally think that is good for some RP purposes.

    • Romana: Este o harta pe care am facut-o cu aproximativ un an si jumatate in urma pentru un server pe care jucam. Apoi am schimbat orasul si nu am mai avut nevoie de ea, deci asa ca o fac publica. Eu cred ca este de folos in anumite situatii de RP.

    Video

    (The bugs that you see in the video, are fixed / Problemele care le vedeti in film sunt reparate)

    Las Venturas Docks

    Misc. Information

    Misc. Information

    Location: Las Venturas

    Worktime: 3 days

    Objects: 230

    Bugs: Until now, I don`t actually know any bugs.

    Version: 1.1

    New version in progress: No

    Download

    •Pastebin: HERE

    Enjoy!

  6. Te referi sa scrii /dd si sa creezi o casa cumparabila?

    EDIT: Daca vrei doar sa creezi obiectul poti folosi CreateObject si sa iei pozitia ta, adaugi 1(sau mai mult) la X sau Y (sau Z dupa nevoie) si creezi obiectul. Daca nu, iti trebuie un house system.

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