sistem de case
#1

salut ,am gasit si eu sistemul asta de case pe net si vreau sa rezolv doua mici probleme la el...

1. De fiecare data cand intru in checkpoint-ul casei indiferent ca este cumparata sau nu imi tot apare dialogul sa cumpar casa.
2.Cum fac sa salvez coordonatele interiorului? adica mie in folderul cu casele salvate la interior x,y,z imi apare 0 la toate... si cand ii setez doar interiorul nu merge comanda enter..

codul este:
Код:
#include <a_samp>
#include <YSI/y_ini>
#include <zcmd>
#include <sscanf2>
#include <streamer>

#define GREY       0xAFAFAFAA
#define BLUE2      0x4682B4FF
#define RED        0xFF0000AA
#define YELLOW     0xE9E312FF
#define ORANGE     0xFF9900AA
#define WHITE      0xFFFEFFFF
#define GREEN      0x33AA33AA
#define BLUE       0x0000FFFF
#define LIGHTGREEN 0x90EE90FF
#define OLIVE      0x808000FF
#define SALAMON    0xFA8072FF
#define BLACK      0x000000FF

#define C_GREY       "{AFAFAF}"
#define C_BLUE2      "{4682B4}"
#define C_RED        "{FF0000}"
#define C_YELLOW     "{E9E312}"
#define C_ORANGE     "{FF9900}"
#define C_WHITE      "{FFFEFF}"
#define C_GREEN      "{33AA33}"
#define C_BLUE       "{0000FF}"
#define C_LIGHTGREEN "{90EE90}"
#define C_OLIVE      "{808000}"
#define C_SALAMON    "{FA8072}"
#define C_BLACK      "{000000}"

#define MAX_HOUSE 100
#define HousePATH "GameMod/House/%d.ini"

enum hInfo
{
	hOwner[24],
	Text3D:hLabel,
	hPickup,
	Float:hEnterX,
	Float:hEnterY,
	Float:hEnterZ,
	Float:hExitX,
	Float:hExitY,
	Float:hExitZ,
	hInterior,
	hCost,
	hSell
};

new HouseInfo[MAX_PLAYERS][hInfo];
new MaDom[MAX_PLAYERS];
new Float:X, Float:Y, Float:Z;
new houseid;
new HouseCount;

forward CreateHouse(playerid, koszt, sprzedaz, intek);
forward LoadHouse_data(playerid, name[], value[]);

public OnPlayerConnect(playerid)
{
	HouseInfo[playerid][hOwner] = 0;
	HouseInfo[playerid][hEnterX] = 0;
	HouseInfo[playerid][hEnterY] = 0;
	HouseInfo[playerid][hEnterZ] = 0;
	HouseInfo[playerid][hExitX] = 0;
	HouseInfo[playerid][hExitY] = 0;
	HouseInfo[playerid][hExitZ] = 0;
	HouseInfo[playerid][hInterior] = 0;
	HouseInfo[playerid][hCost] = 0;
	HouseInfo[playerid][hSell] = 0;
	MaDom[playerid] = 0;
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	if(MaDom[playerid] == 1)
	{
        for(new h = 0; h < sizeof(HouseInfo); h++)
    	{
    	    new INI:File = INI_Open(HousePath());
    	    INI_WriteString(File, "Wlasciciel", HouseInfo[playerid][hOwner]);
    	    INI_WriteFloat(File, "WejscieX", HouseInfo[playerid][hEnterX]);
    	    INI_WriteFloat(File, "WejscieY", HouseInfo[playerid][hEnterY]);
    	    INI_WriteFloat(File, "WejscieZ", HouseInfo[playerid][hEnterZ]);
    	    INI_WriteFloat(File, "WyjscieX", HouseInfo[playerid][hExitX]);
    	    INI_WriteFloat(File, "WyjscieY", HouseInfo[playerid][hExitY]);
    	    INI_WriteFloat(File, "WyjscieZ", HouseInfo[playerid][hExitZ]);
    	    INI_WriteInt(File, "Interior", HouseInfo[playerid][hInterior]);
    	    INI_WriteInt(File, "Cena", HouseInfo[playerid][hCost]);
    	    INI_WriteInt(File, "Sprzedaz", HouseInfo[playerid][hSell]);
    	}
    }
    return 1;
 }
	    
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
	for(new h = 0; h < MAX_HOUSE; h++)
    {
    	if(checkpointid == HouseInfo[playerid][hPickup])
    	{
    		if(!fexist(HousePath()))
    		{
    			INI_ParseFile(HousePath(), "LoadHouse_%d", .bExtra = true, .extra = playerid);
    		    ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "Dom", "This is your home \n Do you want to enter it? ", "Tak", "Nie");
    		}
    	    else
        	{
    		    ShowPlayerDialog(playerid, 5001, DIALOG_STYLE_MSGBOX, "Dom", "This house is for sale. Want to buy it? ", "Tak", "Nie");
    	    }
		}
	}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 5001)
	{
		if(response)
		{
            if(GetPlayerMoney(playerid) > HouseInfo[playerid][hCost])
	    	{
				MaDom[playerid] = 1;
            	SendClientMessage(playerid, GREEN, "House. ");

            	new string[128];
            	format(string, sizeof string, ""C_BLUE2"Wlasciciel : "C_BLUE2"%s ", PlayerName(playerid));
             	Update3DTextLabelText(HouseInfo[playerid][hLabel], RED, string);

            	new INI:File = INI_Open(HousePath());
            	INI_WriteString(File, "Wlasciciel", PlayerName(playerid));
            	INI_WriteFloat(File, "WejscieX", HouseInfo[playerid][hEnterX]);
             	INI_WriteFloat(File, "WejscieY", HouseInfo[playerid][hEnterY]);
               	INI_WriteFloat(File, "WejscieZ", HouseInfo[playerid][hEnterZ]);
             	INI_WriteFloat(File, "WyjscieX", HouseInfo[playerid][hExitX]);
              	INI_WriteFloat(File, "WyjscieY", HouseInfo[playerid][hExitY]);
               	INI_WriteFloat(File, "WyjscieZ", HouseInfo[playerid][hExitZ]);
              	INI_WriteInt(File, "Interior", HouseInfo[playerid][hInterior]);
                INI_WriteInt(File, "Cena", HouseInfo[playerid][hCost]);
             	INI_WriteInt(File, "Sprzedaz", HouseInfo[playerid][hSell]);
            	INI_Close(File);
		    }
		    else SendClientMessage(playerid, LIGHTGREEN, "You can not afford this house! ");
    	}
	}
	return 1;
}

cmd(nowydom, playerid, params[])
{
	new cost, sell, interior;
	
	if(sscanf(params, "ddd", cost, sell, interior))
		return SendClientMessage(playerid, SALAMON, "Wpisz : /nowydom cost price interior ");
		
	CreateHouse(playerid, cost, sell, interior);
	return 1;
}

public CreateHouse(playerid, koszt, sprzedaz, intek)
{

	GetPlayerPos(playerid, X, Y, Z);
	new INI:File = INI_Open(HousePath());
	
	HouseCount++;
	HouseInfo[playerid][hEnterX] = X;
	HouseInfo[playerid][hEnterY] = Y;
	HouseInfo[playerid][hEnterZ] = Z;
	HouseInfo[playerid][hInterior] = intek;
	HouseInfo[playerid][hCost] = koszt;
	HouseInfo[playerid][hSell] = sprzedaz;
	
	INI_WriteFloat(File, "WejscieX", HouseInfo[playerid][hEnterX]);
	INI_WriteFloat(File, "WejscieY", HouseInfo[playerid][hEnterY]);
	INI_WriteFloat(File, "WejscieZ", HouseInfo[playerid][hEnterZ]);
	INI_WriteFloat(File, "WyjscieX", 0);
	INI_WriteFloat(File, "WyjscieY", 0);
	INI_WriteFloat(File, "WyjscieZ", 0);
	INI_WriteInt(File, "Interior", HouseInfo[playerid][hInterior]);
	INI_WriteInt(File, "Cena", HouseInfo[playerid][hCost]);
	INI_WriteInt(File, "Sprzedaz", HouseInfo[playerid][hSell]);
	INI_Close(File);
	
	new string[128];
	format(string, sizeof string, ""C_BLUE2"Wlasciciel : "C_YELLOW"brak \n"C_BLUE2"Koszt : "C_YELLOW"%d\n", koszt);
	HouseInfo[playerid][hLabel] = Create3DTextLabel(string, RED, X, Y, Z, 7.0, 0);
	
	HouseInfo[houseid][hPickup] = CreateDynamicCP(X, Y, Z, 2, 0, 0, 0, 20);
	return 1;
}

public LoadHouse_data(playerid, name[], value[])
{
	new Name[24], string[128];
	GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
	INI_String("Wlasciciel", Name, 48);
	INI_Float("WejscieX", HouseInfo[playerid][hEnterX]);
	INI_Float("WejscieY", HouseInfo[playerid][hEnterY]);
	INI_Float("WejscieZ", HouseInfo[playerid][hEnterZ]);
	INI_Float("WyjscieX", HouseInfo[playerid][hExitX]);
	INI_Float("WyjscieY", HouseInfo[playerid][hExitY]);
	INI_Float("WyjscieZ", HouseInfo[playerid][hExitZ]);
	INI_Int("Interior", HouseInfo[playerid][hInterior]);
	INI_Int("Cena", HouseInfo[playerid][hCost]);
	INI_Int("Sprzedaz", HouseInfo[playerid][hSell]);
	
	if(HouseInfo[playerid][hOwner] == 1)
	{
    	format(string, sizeof string, ""C_BLUE2"Wlasciciel : "C_YELLOW"%s \n", Name);
    	HouseInfo[playerid][hLabel] = Create3DTextLabel(string, RED, HouseInfo[playerid][hEnterX], HouseInfo[playerid][hEnterZ], HouseInfo[playerid][hEnterZ], 7.0, 0);
    	HouseInfo[houseid][hPickup] = CreateDynamicCP(HouseInfo[playerid][hEnterX], HouseInfo[playerid][hEnterY], HouseInfo[playerid][hEnterZ], 2, 0, 0, 0, 20);
	}
	else
	{
    	format(string, sizeof string, ""C_BLUE2"Wlasciciel : "C_YELLOW"brak \n"C_BLUE2"Koszt : "C_YELLOW"%d\n", HouseInfo[playerid][hCost]);
    	HouseInfo[playerid][hLabel] = Create3DTextLabel(string, RED, HouseInfo[playerid][hEnterX], HouseInfo[playerid][hEnterZ], HouseInfo[playerid][hEnterZ], 7.0, 0);
    	HouseInfo[houseid][hPickup] = CreateDynamicCP(HouseInfo[playerid][hEnterX], HouseInfo[playerid][hEnterY], HouseInfo[playerid][hEnterZ], 2, 0, 0, 0, 20);
    }
	return 1;
}

stock HousePath()
{
	new string[256];
	format(string, sizeof string, HousePATH, HouseCount);
	return string;
}

stock PlayerName(playerid)
{
	new name[24];
	GetPlayerName(playerid, name, MAX_PLAYER_NAME);
	return name;
}
Reply
#2

De ce nu incerci sa iti faci tu propriul sistem de case? In special daca ai putea sa il faci pe MySQL, deoarece INI este destul de vechi... (Iti recomand sa iei si ultima versiune de YSI 4.0). Sistemul ala pare facut de cineva mai mult la "misto", sa isi bata joc. Mai bine ia unul de Aici.
Reply
#3

Quote:
Originally Posted by 10MIN
Посмотреть сообщение
De ce nu incerci sa iti faci tu propriul sistem de case? In special daca ai putea sa il faci pe MySQL, deoarece INI este destul de vechi... (Iti recomand sa iei si ultima versiune de YSI 4.0). Sistemul ala pare facut de cineva mai mult la "misto", sa isi bata joc. Mai bine ia unul de Aici.
SQL Lite e mai rapid de cit MySQL!
Reply
#4

ma frate acest scripter, e posibil un incepator are mult cod scris in zadar! e mai bine sa incepi creezi aceasta sistem model baza de date SQL Lite, e cu mult mai rapid (optimizat)
Reply
#5

In legatura cu SQL Lite ,nu prea imi place cu baza de date ,deoarece nu stiu codurile in pawno, asa cu YSI cat de cat ma descurc ...

Iar acum am reusit sa fac o branza cat de cat ,dar acum cand dau createhouse nu imi apare pickup-ul cu casa aceea verde... ma puteti ajuta putin ? ...


Код:
#include 			<a_samp>
#include 			<a_npc>
#include 			<zcmd>
#include 			<foreach>
#include            <sscanf2>
#include 			<streamer>
#include 			<YSI\y_ini>

#define COLOR_GREY       0xAFAFAFAA
#define COLOR_BLUE2      0x4682B4FF
#define COLOR_RED        0xFF0000AA
#define COLOR_YELLOW     0xE9E312FF
#define COLOR_ORANGE     0xFF9900AA
#define COLOR_WHITE      0xFFFEFFFF
#define COLOR_GREEN      0x33AA33AA
#define COLOR_BLUE       0x0000FFFF
#define COLOR_LIGHTGREEN 0x90EE90FF
#define COLOR_OLIVE      0x808000FF
#define COLOR_SALAMON    0xFA8072FF
#define COLOR_BLACK      0x000000FF

enum
{
    HOUSE_MENU,
    HOUSE_LEVEL,
    HOUSE_INTERIOR,
    HOUSE_PRICE,
    HOUSE_BUY,
    HOUSE_ID
}

enum hInfo {
    bool:hOwned,
    hOwner[MAX_PLAYER_NAME],
    hID, //house id
    hLevel,
    Text3D:hLabel,
    Float:hEX, //house exterior X
    Float:hEY,
    Float:hEZ,
    Float:hIX, //house interior x
    Float:hIY,
    Float:hIZ,
    hInterior,
    hPickup,
    hPrice
};
new HouseInfo[MAX_PLAYERS][hInfo];
new HouseCount;
new houseid;

#define HousePATH "House/%d.ini"
#define MAX_HOUSES 100

forward LoadHouse_data(playerid, name[], value[]);
public LoadHouse_data(playerid, name[], value[])
{
	new Name[24], string[128];
	GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
	INI_String("Owner", Name, 48);
	INI_Float("HEX", HouseInfo[playerid][hEX]);
	INI_Float("HEY", HouseInfo[playerid][hEY]);
	INI_Float("HEZ", HouseInfo[playerid][hEZ]);
	INI_Float("HIX", HouseInfo[playerid][hIX]);
	INI_Float("HIY", HouseInfo[playerid][hIY]);
	INI_Float("HIZ", HouseInfo[playerid][hIZ]);
	INI_Int("hInterior", HouseInfo[playerid][hInterior]);
	INI_Int("hPick", HouseInfo[playerid][hPickup]);
	INI_Int("hPrice", HouseInfo[playerid][hPrice]);
	INI_Int("HouseID", HouseInfo[playerid][hID]);
	INI_Int("HouseLevel", HouseInfo[playerid][hLevel]);
	INI_Int("HousePrice", HouseInfo[playerid][hPrice]);

	if(HouseInfo[playerid][hOwner] == 1)
	{
    	format(string, sizeof string, "Owner : " "%s \n", Name);
    	HouseInfo[playerid][hLabel] = Create3DTextLabel(string, COLOR_RED, HouseInfo[playerid][hEX], HouseInfo[playerid][hEY], HouseInfo[playerid][hEZ], 7.0, 0);
    	HouseInfo[houseid][hPickup] = CreateDynamicCP(HouseInfo[playerid][hEX], HouseInfo[playerid][hEY], HouseInfo[playerid][hEZ], 2, 0, 0, 0, 20);
	}
	else
	{
    	format(string, sizeof string, "Owner : " "The State \n" "Pret : " "%d\n", HouseInfo[playerid][hPrice]);
    	HouseInfo[playerid][hLabel] = Create3DTextLabel(string, COLOR_RED, HouseInfo[playerid][hEX], HouseInfo[playerid][hEY], HouseInfo[playerid][hEZ], 7.0, 0);
    	HouseInfo[houseid][hPickup] = CreateDynamicCP(HouseInfo[playerid][hEX], HouseInfo[playerid][hEY], HouseInfo[playerid][hEZ], 2, 0, 0, 0, 20);
    }
	return 1;
}

CMD:givemoney(playerid, params[])
{
    new targetid, amount;
    if(sscanf(params, "ud", targetid, amount)) return SendClientMessage(playerid, -1, "usage - /givemoney <playerid/part of name> <amount>");
	if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Player is not connected");
	GivePlayerMoney(targetid, amount);
	SetPlayerScore(targetid, GetPlayerScore(targetid) + 1);
	return 1;
}

CMD:createhouse(playerid,params[])
{
 	ShowPlayerDialog(playerid, HOUSE_LEVEL, DIALOG_STYLE_INPUT, "House ID", "ID-ul casei.\n" , "Set", "Cancel");
	return 1;
}
CMD:buyhouse(playerid,params[])
{
	for(new h = 0; h < MAX_HOUSES; h++)
    {
		if(!fexist(HousePath()))
		{
			INI_ParseFile(HousePath(), "LoadHouse_%d", .bExtra = true, .extra = playerid);
  			ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "House Sistem", "Asta este casa ta ,vrei sa intri in ea? ", "Da", "Nu");
		}
 		else
		{
 			ShowPlayerDialog(playerid, HOUSE_BUY, DIALOG_STYLE_MSGBOX, "House Sistem", "Vrei sa cumperi aceasta casa? ", "Da", "Nu");
		}
    }
   	return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == HOUSE_BUY)
	{
		if(response)
		{
            if(GetPlayerMoney(playerid) > HouseInfo[playerid][hPrice])
	    	{
            	SendClientMessage(playerid, COLOR_GREEN, "House created ");

            	new string[128];
            	format(string, sizeof string, "House ID : %d" "Owner: %s \n",HouseInfo[playerid][hID], PlayerName(playerid));
             	Update3DTextLabelText(HouseInfo[playerid][hLabel], COLOR_RED, string);

            	new INI:File = INI_Open(HousePath());
				INI_WriteString(File, "Owned", PlayerName(playerid));
				INI_WriteInt(File, "HouseID", HouseInfo[playerid][hID]);
				INI_WriteInt(File, "HouseLevel", HouseInfo[playerid][hLevel]);
				INI_WriteInt(File, "HousePrice", HouseInfo[playerid][hPrice]);
				INI_WriteFloat(File, "HEX", HouseInfo[playerid][hEX]);
				INI_WriteFloat(File, "HEY", HouseInfo[playerid][hEY]);
				INI_WriteFloat(File, "HEZ", HouseInfo[playerid][hEZ]);
				INI_WriteFloat(File, "HIZ", HouseInfo[playerid][hIX]);
				INI_WriteFloat(File, "HIY", HouseInfo[playerid][hIY]);
				INI_WriteFloat(File, "HIZ", HouseInfo[playerid][hIZ]);
				INI_WriteInt(File, "HInt", HouseInfo[playerid][hInterior]);
            	INI_Close(File);
		    }
		    else SendClientMessage(playerid, COLOR_LIGHTGREEN, "You can not afford this house! ");
    	}
	}
	if(dialogid == HOUSE_ID && response)
	{
	   new str[120];
	   if(!strlen(inputtext)) return ShowPlayerDialog(playerid, HOUSE_LEVEL, DIALOG_STYLE_INPUT, "House ID", "ID-ul casei.\n" , "Set", "Cancel");
	   format(str, sizeof str, "ID-ul casei este %d casei tale", strval(inputtext));
	   HouseInfo[playerid][hID] = strval(inputtext);
       new INI:File = INI_Open(HousePath());
       INI_WriteInt(File, "HouseID", HouseInfo[playerid][hID]);
       INI_Close(File);
	   ShowPlayerDialog(playerid, HOUSE_LEVEL, DIALOG_STYLE_INPUT, "House Level", "Alege un level care vrei sa il aiba casa ta.\n" , "Set", "Cancel");
	}
	if(dialogid == HOUSE_LEVEL && response)
	{
	   new str[120];
	   if(!strlen(inputtext)) return ShowPlayerDialog(playerid, HOUSE_LEVEL, DIALOG_STYLE_INPUT, "House Level", "Alege un level care vrei sa il aiba casa ta.\n" , "Set", "Cancel");
	   format(str, sizeof str, "Ai setat level %d casei tale", strval(inputtext));
	   HouseInfo[playerid][hLevel] = strval(inputtext);
       new INI:File = INI_Open(HousePath());
       INI_WriteInt(File, "HouseLevel", HouseInfo[playerid][hLevel]);
       INI_Close(File);
	   ShowPlayerDialog(playerid,HOUSE_INTERIOR, DIALOG_STYLE_INPUT, "House INT", "Alege interiorul casei:", "Set", "Cancel");
	}
	if(dialogid == HOUSE_INTERIOR && response)
	{
       new str[120];
	   if(!strlen(inputtext)) return ShowPlayerDialog(playerid, HOUSE_INTERIOR, DIALOG_STYLE_INPUT, "House Interior", "Alege un level care vrei sa il aiba casa ta.\n" , "Set", "Cancel");
	   format(str, sizeof str, "Ai setat interiorul %d", strval(inputtext));
	   HouseInfo[playerid][hInterior] = strval(inputtext);
	   ShowPlayerDialog(playerid, HOUSE_PRICE, DIALOG_STYLE_INPUT, "House Price", "Alege pretul casei.\n" , "Set", "Cancel");
	}
	if(dialogid == HOUSE_PRICE && response)
	{
	   new str[120],hprice, Float:X, Float:Y, Float:Z;
	   GetPlayerPos(playerid, X, Y, Z);
	   HouseInfo[playerid][hPrice] = hprice;
	   if(!strlen(inputtext)) return ShowPlayerDialog(playerid, HOUSE_PRICE, DIALOG_STYLE_INPUT, "House Price", "Alege pretul casei.\n" , "Set", "Cancel");
	   format(str, sizeof str, "Casa costa %d$", strval(inputtext));
	   HouseInfo[playerid][hPrice] = strval(inputtext);
       new INI:File = INI_Open(HousePath());
       INI_WriteInt(File, "HousePrice", HouseInfo[playerid][hPrice]);
       INI_Close(File);
   	   new string[128];
	   format(string, sizeof string, "Owner : brak \n" "Pret : %d\n", hprice);
	   HouseInfo[playerid][hLabel] = Create3DTextLabel(string, COLOR_RED, X, Y, Z, 7.0, 0);
	   HouseInfo[playerid][hPickup] = CreateDynamicPickup(1273, 1, X, Y, X, -1, -1, -1, 100.0);
	}
	return 1;
}


public OnPlayerDisconnect(playerid, reason)
{
	new INI:File = INI_Open(HousePath());
	INI_SetTag(File,"data");
	INI_WriteString(File, "Owned", HouseInfo[playerid][hOwner]);
	INI_WriteInt(File, "HouseID", HouseInfo[playerid][hID]);
	INI_WriteInt(File, "HouseLevel", HouseInfo[playerid][hLevel]);
	INI_WriteInt(File, "HousePrice", HouseInfo[playerid][hPrice]);
	INI_WriteFloat(File, "HEX", HouseInfo[playerid][hEX]);
	INI_WriteFloat(File, "HEY", HouseInfo[playerid][hEY]);
	INI_WriteFloat(File, "HEZ", HouseInfo[playerid][hEZ]);
	INI_WriteFloat(File, "HIZ", HouseInfo[playerid][hIX]);
	INI_WriteFloat(File, "HIY", HouseInfo[playerid][hIY]);
	INI_WriteFloat(File, "HIZ", HouseInfo[playerid][hIZ]);
	INI_WriteInt(File, "HInt", HouseInfo[playerid][hInterior]);
	INI_Close(File);
    return 1;
 }
main()
{
	print("\n----------------------------------");
	print("  Bare Script\n");
	print("----------------------------------\n");
}

public OnPlayerConnect(playerid)
{
	GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	new idx;
	new cmd[256];
	
	cmd = strtok(cmdtext, idx);

	if(strcmp(cmd, "/yadayada", true) == 0) {
    	return 1;
	}

	return 0;
}

public OnPlayerSpawn(playerid)
{
	SetPlayerInterior(playerid,0);
	TogglePlayerClock(playerid,0);
	return 1;
}

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

SetupPlayerForClassSelection(playerid)
{
 	SetPlayerInterior(playerid,14);
	SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
	SetPlayerFacingAngle(playerid, 270.0);
	SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
	SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}

public OnPlayerRequestClass(playerid, classid)
{
	SetupPlayerForClassSelection(playerid);
	return 1;
}

public OnGameModeInit()
{
	SetGameModeText("Bare Script");
	ShowPlayerMarkers(1);
	ShowNameTags(1);
	AllowAdminTeleport(1);

	AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);

	return 1;
}

strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}
stock HousePath()
{
	new string[256];
	format(string, sizeof string, HousePATH, HouseCount);
	return string;
}
stock PlayerName(playerid)
{
	new name[24];
	GetPlayerName(playerid, name, MAX_PLAYER_NAME);
	return name;
}
Reply
#6

@DimaShift fiecare sistem isi are domeniul de utilizare, SQLite foloseste direct aplicatia pentru a face baza de date. In timp ce MySQL trimite totul catre un server care e folosit pentru a face baza de date. Apropo ai buton de edit, foloseste-l!
@xAlecsu vad ca ai facut acolo o "branza" la propriu... Uite-te peste alea de care ti-am zis mai sus... Ca poate o sa le pricepi. Pentru un incepator e mai greu sa le faca de la zero.
Reply
#7

i'm fucking done dude ,mai rau am intrat in balarii ....si apropo multumesc ca m-ai aprobat ca altceva...
Reply
#8

pai eu spun ca MySQL functioneaza mai lent, de cit SQL Lite.. eu deja am testat!
pentru systema cu proprietati ea e super!
Reply
#9

Nu am folosit SQLite, dar tot mai simplu mi se pare MySQL (acu ca am inceput sa folosesc tquery-ul, e ca si cum as avea scriptul mai simplificat). O chestie buna la MySQL e ca serverul de SA-MP poate sa se foloseasca de serverul MySQL de la site-ul web in caz de ceva (util in caz de "urgenta"). La faza cu testul, e normal ca SQLite sa para mai rapid... Ala scrie direct pe baza de date de pe HDD (sau na, SSD pt unii), in timp ce MySQL trimite la serverul MySQL care proceseaza comanda si dupa o scrie in baza de date. La faza ca e mai bun la proprietati, nu prea vad care e avantajul, ca doar nu le incarci la secunda.
Reply
#10

sunt deacord cu tine! la datele playerului e cel mai bun MySql, iar la salvarea obiecte, cars , house e mai bun Sql lite ....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)