Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #include <sscanf2>
- #include <zcmd>
- new hpickup[100];
- new maxbuyhouse = 1;
- new Text3D:dtextlabel[100];
- new houseid2[MAX_PLAYERS];
- forward LoadHouses();
- forward SaveHouse();
- forward SaveThisHouse(houseid);
- forward SendAdminMesaj(color,const string[]);
- enum PlayerData
- {
- pPropietati,
- }
- new PlayerInfo[MAX_PLAYERS][PlayerData];
- enum HouseData
- {
- Float:Intrarex,
- Float:Intrarey,
- Float:Intrarez,
- Float:Iesirex,
- Float:Iesirey,
- Float:Iesirez,
- Valoare,
- Propietar[MAX_PLAYER_NAME],
- Camere,
- Seif,
- Cumparata,
- Inchisa,
- Interior,
- Virtual,
- }
- new HouseInfo[MAX_PLAYERS][HouseData];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" House System by Gireada");
- print("--------------------------------------\n");
- LoadHouses();
- new string2[700];
- for(new idx = 1; idx<sizeof(HouseInfo); idx++)
- {
- if(HouseInfo[idx][Cumparata] == 1)
- {
- hpickup[idx] = CreatePickup(1272, 1, HouseInfo[idx][Intrarex], HouseInfo[idx][Intrarey], HouseInfo[idx][Intrarez], -1);
- format(string2, sizeof(string2), " Propietar: %s \n Valoare: %d \n Interior: %d \n Virtual: %d \n Camere: %d",HouseInfo[idx][Propietar], HouseInfo[idx][Valoare],HouseInfo[idx][Interior],HouseInfo[idx][Virtual], HouseInfo[idx][Camere]);
- dtextlabel[idx] = Create3DTextLabel(string2, 0x7FFF00FF, HouseInfo[idx][Intrarex], HouseInfo[idx][Intrarey], HouseInfo[idx][Intrarez], 20.0, 0, 0);
- }
- else if(HouseInfo[idx][Cumparata] == 0)
- {
- hpickup[idx] = CreatePickup(1273, 1, HouseInfo[idx][Intrarex], HouseInfo[idx][Intrarey], HouseInfo[idx][Intrarez], -1);
- format(string2, sizeof(string2), " Propietar: %s\nValoare: %d\nInterior: %d\n Virtual: %d \n Camere: %d",HouseInfo[idx][Propietar], HouseInfo[idx][Valoare],HouseInfo[idx][Interior],HouseInfo[idx][Virtual], HouseInfo[idx][Camere]);
- dtextlabel[idx] = Create3DTextLabel(string2, 0xFF4500FF, HouseInfo[idx][Intrarex], HouseInfo[idx][Intrarey], HouseInfo[idx][Intrarez], 20.0, 0, 0);
- }
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" House System by Gireada");
- print("----------------------------------\n");
- }
- public OnPlayerConnect(playerid)
- {
- new file[80];
- format(file, sizeof(file),"JucatoriCase/%s.ini", pName(playerid));
- if(dini_Exists(file))
- {
- PlayerInfo[playerid][pPropietati] = dini_Int(file,"Propietati");
- }
- else if(!dini_Exists(file))
- {
- dini_Create(file);
- dini_IntSet(file,"Propietati",PlayerInfo[playerid][pPropietati] = 0);
- }
- houseid2[playerid] = 0;
- 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("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- CMD:acreatehouse(playerid, params[])
- {
- new string[256],string2[700], model, valoare, virtual;
- new name[35];
- GetPlayerName(playerid, name, sizeof(name));
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- new stat[MAX_PLAYERS];
- format(stat, sizeof(stat), "Stat");
- if(unformat(params, "iii", model,valoare,virtual))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Foloseste: /acreatehouse <model> <valoare> <virtual>");
- return 1;
- }
- if(!(model > 0 && model < 8))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Modelul trebuie cuprins intre 1 si 7");
- return 1;
- }
- if(!(valoare > 0 && valoare < 5000000))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Valoarea trebuie cuprins intre 0 si 5000000$");
- return 1;
- }
- for(new h=1;h<sizeof(HouseInfo);h++)
- {
- if(IsPlayerAdmin(playerid))
- {
- if(IsPlayerConnected(playerid))
- {
- if(HouseInfo[h][Intrarex] == 0 && HouseInfo[h][Intrarey] == 0 && HouseInfo[h][Intrarez] == 0)
- {
- if(model == 1)
- {
- strmid(HouseInfo[h][Propietar], "Stat", 0, strlen("Stat"), 999);
- HouseInfo[h][Intrarex] = x; HouseInfo[h][Intrarey] = y; HouseInfo[h][Intrarez] = z; HouseInfo[h][Camere] = 6;
- HouseInfo[h][Iesirex] = 235.508994; HouseInfo[h][Iesirey] = 1189.169897; HouseInfo[h][Iesirez] = 1080.339966;
- HouseInfo[h][Interior] = 3; HouseInfo[h][Virtual] = virtual; HouseInfo[h][Cumparata] = 0; HouseInfo[h][Inchisa] = 0; HouseInfo[h][Valoare] = valoare;
- hpickup[h] = CreatePickup(1273, 1, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], -1);
- format(string, sizeof(string), " %s a creiat propietatea %d.",name, h);
- SendAdminMesaj(0xFFFFFFFF,string);
- format(string2, sizeof(string2), " Propietar: %s\n Valoare: %d\n Interior: %d\n Virtual: %d \n Camere: %d",HouseInfo[h][Propietar], HouseInfo[h][Valoare],HouseInfo[h][Interior],HouseInfo[h][Virtual], HouseInfo[h][Camere]);
- dtextlabel[h] = Create3DTextLabel(string2, 0x7FFF00FF, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], 20.0, 0, 0);
- printf("%s a creiat casa %d.",name, h); SaveThisHouse(h);break;
- }
- else if(model == 2)
- {
- strmid(HouseInfo[h][Propietar], "Stat", 0, strlen("Stat"), 999);
- HouseInfo[h][Intrarex] = x; HouseInfo[h][Intrarey] = y; HouseInfo[h][Intrarez] = z;
- HouseInfo[h][Iesirex] = 225.756989; HouseInfo[h][Iesirey] = 1240.000000; HouseInfo[h][Iesirez] = 1082.149902; HouseInfo[h][Camere] = 2;
- HouseInfo[h][Interior] = 2; HouseInfo[h][Virtual] = virtual; HouseInfo[h][Cumparata] = 0; HouseInfo[h][Inchisa] = 0; HouseInfo[h][Valoare] = valoare;
- hpickup[h] = CreatePickup(1273, 1, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], -1);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), " %s a creiat propietatea %d.",name, h);
- SendAdminMesaj(0xFFFFFFFF,string);
- format(string2, sizeof(string2), " Propietar: %s\nValoare: %d\nInterior: %d\n Virtual: %d \n Camere: %d",HouseInfo[h][Propietar], HouseInfo[h][Valoare],HouseInfo[h][Interior],HouseInfo[h][Virtual], HouseInfo[h][Camere]);
- dtextlabel[h] = Create3DTextLabel(string2, 0x7FFF00FF, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], 20.0, 0, 0);
- printf("%s a creiat casa %d.",name, h); SaveThisHouse(h);break;
- }
- else if(model == 3)
- {
- strmid(HouseInfo[h][Propietar], "Stat", 0, strlen("Stat"), 999);
- HouseInfo[h][Intrarex] = x; HouseInfo[h][Intrarey] = y; HouseInfo[h][Intrarez] = z; HouseInfo[h][Camere] = 3;
- HouseInfo[h][Iesirex] = 223.043991; HouseInfo[h][Iesirey] = 1289.259888; HouseInfo[h][Iesirez] = 1082.199951;
- HouseInfo[h][Interior] = 1; HouseInfo[h][Virtual] = virtual; HouseInfo[h][Cumparata] = 0; HouseInfo[h][Inchisa] = 0; HouseInfo[h][Valoare] = valoare;
- hpickup[h] = CreatePickup(1273, 1, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], -1);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), " %s a creiat propietatea %d.",name, h);
- SendAdminMesaj(0xFFFFFFFF,string);
- format(string2, sizeof(string2), " Propietar: %s\nValoare: %d\nInterior: %d\n Virtual: %d \n Camere: %d",HouseInfo[h][Propietar], HouseInfo[h][Valoare],HouseInfo[h][Interior],HouseInfo[h][Virtual], HouseInfo[h][Camere]);
- dtextlabel[h] = Create3DTextLabel(string2, 0x7FFF00FF, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], 20.0, 0, 0);
- printf("%s a creiat casa %d.",name, h); SaveThisHouse(h);break;
- }
- else if(model == 4)
- {
- strmid(HouseInfo[h][Propietar], "Stat", 0, strlen("Stat"), 999);
- HouseInfo[h][Intrarex] = x; HouseInfo[h][Intrarey] = y; HouseInfo[h][Intrarez] = z;
- HouseInfo[h][Iesirex] = 225.630997; HouseInfo[h][Iesirey] = 1022.479980; HouseInfo[h][Iesirez] = 1084.069946; HouseInfo[h][Camere] = 7;
- HouseInfo[h][Interior] = 7; HouseInfo[h][Virtual] = virtual; HouseInfo[h][Cumparata] = 0; HouseInfo[h][Inchisa] = 0; HouseInfo[h][Valoare] = valoare;
- hpickup[h] = CreatePickup(1273, 1, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], -1);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), " %s a creiat propietatea %d.",name, h);
- SendAdminMesaj(0xFFFFFFFF,string);
- format(string2, sizeof(string2), " Propietar: %s\nValoare: %d\nInterior: %d\n Virtual: %d \n Camere: %d",HouseInfo[h][Propietar], HouseInfo[h][Valoare],HouseInfo[h][Interior],HouseInfo[h][Virtual], HouseInfo[h][Camere]);
- dtextlabel[h] = Create3DTextLabel(string2, 0x7FFF00FF, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], 20.0, 0, 0);
- printf("%s a creiat casa %d.",name, h); SaveThisHouse(h);break;
- }
- else if(model == 5)
- {
- strmid(HouseInfo[h][Propietar], "Stat", 0, strlen("Stat"), 999);
- HouseInfo[h][Intrarex] = x; HouseInfo[h][Intrarey] = y; HouseInfo[h][Intrarez] = z; HouseInfo[h][Camere] = 5;
- HouseInfo[h][Iesirex] = 295.138977; HouseInfo[h][Iesirey] = 1474.469971; HouseInfo[h][Iesirez] = 1080.519897;
- HouseInfo[h][Interior] = 15; HouseInfo[h][Virtual] = virtual; HouseInfo[h][Cumparata] = 0; HouseInfo[h][Inchisa] = 0; HouseInfo[h][Valoare] = valoare;
- hpickup[h] = CreatePickup(1273, 1, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], -1);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), " %s a creiat propietatea %d.",name, h);
- SendAdminMesaj(0xFFFFFFFF,string);
- format(string2, sizeof(string2), " Propietar: %s\nValoare: %d\nInterior: %d\n Virtual: %d \n Camere: %d",HouseInfo[h][Propietar], HouseInfo[h][Valoare],HouseInfo[h][Interior],HouseInfo[h][Virtual], HouseInfo[h][Camere]);
- dtextlabel[h] = Create3DTextLabel(string2, 0x7FFF00FF, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], 20.0, 0, 0);
- printf("%s a creiat casa %d.",name, h); SaveThisHouse(h);break;
- }
- else if(model == 6)
- {
- strmid(HouseInfo[h][Propietar], "Stat", 0, strlen("Stat"), 999);
- HouseInfo[h][Intrarex] = x; HouseInfo[h][Intrarey] = y; HouseInfo[h][Intrarez] = z;
- HouseInfo[h][Iesirex] = 328.493988; HouseInfo[h][Iesirey] = 1480.589966; HouseInfo[h][Iesirez] = 1084.449951; HouseInfo[h][Camere] = 5;
- HouseInfo[h][Interior] = 15; HouseInfo[h][Virtual] = virtual; HouseInfo[h][Cumparata] = 0; HouseInfo[h][Inchisa] = 0; HouseInfo[h][Valoare] = valoare;
- hpickup[h] = CreatePickup(1273, 1, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], -1);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), " %s a creiat propietatea %d.",name, h);
- SendAdminMesaj(0xFFFFFFFF,string);
- format(string2, sizeof(string2), " Propietar: %s\nValoare: %d\nInterior: %d\n Virtual: %d \n Camere: %d",HouseInfo[h][Propietar], HouseInfo[h][Valoare],HouseInfo[h][Interior],HouseInfo[h][Virtual], HouseInfo[h][Camere]);
- dtextlabel[h] = Create3DTextLabel(string2, 0x7FFF00FF, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], 20.0, 0, 0);
- printf("%s a creiat casa %d.",name, h); SaveThisHouse(h);break;
- }
- else if(model == 7)
- {
- strmid(HouseInfo[h][Propietar], "Stat", 0, strlen("Stat"), 999);
- HouseInfo[h][Intrarex] = x; HouseInfo[h][Intrarey] = y; HouseInfo[h][Intrarez] = z;
- HouseInfo[h][Iesirex] = 385.803986; HouseInfo[h][Iesirey] = 1471.769897; HouseInfo[h][Iesirez] = 1080.209961; HouseInfo[h][Camere] = 3;
- HouseInfo[h][Interior] = 15; HouseInfo[h][Virtual] = virtual; HouseInfo[h][Cumparata] = 0; HouseInfo[h][Inchisa] = 0; HouseInfo[h][Valoare] = valoare;
- hpickup[h] = CreatePickup(1273, 1, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], -1);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), " %s a creiat propietatea %d.",name, h);
- SendAdminMesaj(0xFFFFFFFF,string);
- format(string2, sizeof(string2), " Propietar: %s\nValoare: %d\nInterior: %d\n Virtual: %d \n Camere: %d",HouseInfo[h][Propietar], HouseInfo[h][Valoare],HouseInfo[h][Interior],HouseInfo[h][Virtual], HouseInfo[h][Camere]);
- dtextlabel[h] = Create3DTextLabel(string2, 0x7FFF00FF, HouseInfo[h][Intrarex], HouseInfo[h][Intrarey], HouseInfo[h][Intrarez], 20.0, 0, 0);
- printf("%s a creiat casa %d.",name, h); SaveThisHouse(h);break;
- }
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Trebuie sa fii conectat.");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Trebuie sa ai admin mai mare de 6");
- return 1;
- }
- }
- return 1;
- }
- CMD:intra(playerid, params[])
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- for(new house=1; house<sizeof(HouseInfo); house++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, HouseInfo[house][Intrarex], HouseInfo[house][Intrarey], HouseInfo[house][Intrarez]))
- {
- if(HouseInfo[house][Inchisa] == 0 || HouseInfo[house][Propietar] == name[playerid])
- {
- houseid2[playerid] = house;
- SetPlayerPos(playerid,HouseInfo[house][Iesirex], HouseInfo[house][Iesirey], HouseInfo[house][Iesirez]);
- SetPlayerInterior(playerid, HouseInfo[house][Interior]);
- SetPlayerVirtualWorld(playerid, HouseInfo[house][Virtual]);break;
- }
- else if(HouseInfo[house][Inchisa] == 1)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Aceasta casa este incuiata!");break;
- }
- }
- }
- return 1;
- }
- CMD:iesi(playerid, params[])
- {
- new house = houseid2[playerid];
- if(IsPlayerInRangeOfPoint(playerid, 1.0, HouseInfo[house][Iesirex], HouseInfo[house][Iesirey], HouseInfo[house][Iesirez]))
- {
- SetPlayerPos(playerid,HouseInfo[house][Intrarex], HouseInfo[house][Intrarey], HouseInfo[house][Intrarez]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- return 1;
- }
- CMD:hcumpara(playerid, params[])
- {
- new name[35],string2[700];
- GetPlayerName(playerid, name, sizeof(name));
- if(PlayerInfo[playerid][pPropietati] > maxbuyhouse)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Ai ajuns la limitate de propietati!");
- }
- for(new house=1; house<sizeof(HouseInfo); house++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, HouseInfo[house][Intrarex], HouseInfo[house][Intrarey], HouseInfo[house][Intrarez]))
- {
- if(HouseInfo[house][Cumparata] == 0)
- {
- if(GetPlayerMoney(playerid) >= HouseInfo[house][Valoare])
- {
- HouseInfo[house][Cumparata] = 1; PlayerInfo[house][pPropietati] += 1;
- strmid(HouseInfo[house][Propietar], name, 0, strlen(name), 255);SaveThisHouse(house);
- DestroyPickup(hpickup[house]);
- hpickup[house] = CreatePickup(1272, 1, HouseInfo[house][Intrarex], HouseInfo[house][Intrarey], HouseInfo[house][Intrarez], -1);
- format(string2, sizeof(string2), " Propietar: %s\n Valoare: %d\n Interior: %d\n Virtual: %d \n Camere: %d",HouseInfo[house][Propietar], HouseInfo[house][Valoare],HouseInfo[house][Interior],HouseInfo[house][Virtual], HouseInfo[house][Camere]);
- Update3DTextLabelText(dtextlabel[house], 0xFF4500FF, string2);
- break;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Nu ai destui bani la tine!");
- break;
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Aceasta casa are deja un propietar!");
- break;
- }
- }
- }
- return 1;
- }
- CMD:hvinde(playerid, params[])
- {
- new name[35], string2[700];
- GetPlayerName(playerid, name, sizeof(name));
- for(new house=1; house<sizeof(HouseInfo); house++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, HouseInfo[house][Intrarex], HouseInfo[house][Intrarey], HouseInfo[house][Intrarez]))
- {
- if(HouseInfo[house][Propietar] == name[playerid])
- {
- HouseInfo[house][Cumparata] = 0; strmid(HouseInfo[house][Propietar], "Stat", 0, strlen("Stat"), 999);
- GivePlayerMoney(playerid, HouseInfo[house][Seif]);
- GivePlayerMoney(playerid, HouseInfo[house][Valoare] / 2);
- HouseInfo[house][Seif] = 0;PlayerInfo[house][pPropietati] += 1;SaveThisHouse(house);
- DestroyPickup(hpickup[house]);
- hpickup[house] = CreatePickup(1273, 1, HouseInfo[house][Intrarex], HouseInfo[house][Intrarey], HouseInfo[house][Intrarez], -1);
- format(string2, sizeof(string2), "Propietar: %s\nValoare: %d\nInterior: %d\n Virtual: %d \n Camere: %d",HouseInfo[house][Propietar], HouseInfo[house][Valoare],HouseInfo[house][Interior],HouseInfo[house][Virtual], HouseInfo[house][Camere]);
- Update3DTextLabelText(dtextlabel[house], 0x7FFF00FF, string2);
- break;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Aceasta nu este propietatea ta!");
- break;
- }
- }
- }
- return 1;
- }
- CMD:hlock(playerid, params[])
- {
- new name[35];
- GetPlayerName(playerid, name, sizeof(name));
- for(new house=1; house<sizeof(HouseInfo); house++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, HouseInfo[house][Intrarex], HouseInfo[house][Intrarey], HouseInfo[house][Intrarez]))
- {
- if(HouseInfo[house][Propietar] == name[playerid])
- {
- if(HouseInfo[house][Inchisa] == 1)
- {
- HouseInfo[house][Inchisa] = 0;
- }
- else if(HouseInfo[house][Inchisa] == 0)
- {
- HouseInfo[house][Inchisa] = 1;
- }
- break;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Aceasta nu este propietatea ta!");
- break;
- }
- }
- }
- return 1;
- }
- CMD:hdepune(playerid, params[])
- {
- new name[MAX_PLAYER_NAME], bani;
- GetPlayerName(playerid, name, sizeof(name));
- new stat[MAX_PLAYERS];
- format(stat, sizeof(stat), "Stat");
- if(unformat(params, "i", bani))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Foloseste: /hdepune <suma> ");
- return 1;
- }
- for(new house=1; house<sizeof(HouseInfo); house++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 10.0, HouseInfo[house][Iesirex], HouseInfo[house][Iesirey], HouseInfo[house][Iesirez]))
- {
- if(HouseInfo[house][Propietar] == name[playerid])
- {
- HouseInfo[house][Seif] += bani;SaveThisHouse(house);break;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Aceasta nu este propietatea ta!");
- break;
- }
- }
- }
- return 1;
- }
- CMD:hscoate(playerid, params[])
- {
- new name[MAX_PLAYER_NAME], bani;
- GetPlayerName(playerid, name, sizeof(name));
- new stat[MAX_PLAYERS];
- format(stat, sizeof(stat), "Stat");
- if(unformat(params, "i", bani))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Foloseste: /hscoate <suma> ");
- return 1;
- }
- for(new house=1; house<sizeof(HouseInfo); house++)
- {
- if(bani > HouseInfo[house][Seif])
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Nu ai destui bani in seiful casei"); break;
- }
- if(IsPlayerInRangeOfPoint(playerid, 10.0, HouseInfo[house][Iesirex], HouseInfo[house][Iesirey], HouseInfo[house][Iesirez]))
- {
- if(HouseInfo[house][Propietar] == name[playerid])
- {
- HouseInfo[house][Seif] -= bani;SaveThisHouse(house);break;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Aceasta nu este propietatea ta!");
- break;
- }
- }
- }
- return 1;
- }
- public SaveHouse()
- {
- new file2[254];
- new idx = 1;
- while(idx<sizeof(HouseInfo))
- {
- format(file2, sizeof(file2),"Case/%d.ini", idx);
- if(dini_Exists(file2))
- {
- dini_FloatSet(file2,"Intrarex",HouseInfo[idx][Intrarex]);
- dini_FloatSet(file2,"Intrarey",HouseInfo[idx][Intrarey]);
- dini_FloatSet(file2,"Intrarez",HouseInfo[idx][Intrarez]);
- dini_FloatSet(file2,"Iesirex",HouseInfo[idx][Iesirex]);
- dini_FloatSet(file2,"Iesirey",HouseInfo[idx][Iesirey]);
- dini_FloatSet(file2,"Iesirez",HouseInfo[idx][Iesirez]);
- dini_IntSet(file2,"Valoare",HouseInfo[idx][Valoare]);
- dini_Set(file2,"Propietar",HouseInfo[idx][Propietar]);
- dini_IntSet(file2,"Camere",HouseInfo[idx][Camere]);
- dini_IntSet(file2,"Seif",HouseInfo[idx][Seif]);
- dini_IntSet(file2,"Cumparata",HouseInfo[idx][Cumparata]);
- dini_IntSet(file2,"Inchisa",HouseInfo[idx][Inchisa]);
- dini_IntSet(file2,"Interior",HouseInfo[idx][Interior]);
- dini_IntSet(file2,"Virtual",HouseInfo[idx][Virtual]);
- idx++;
- return 1;
- }
- else if(!dini_Exists(file2))
- {
- dini_Create(file2);
- dini_FloatSet(file2,"Intrarex",HouseInfo[idx][Intrarex]);
- dini_FloatSet(file2,"Intrarey",HouseInfo[idx][Intrarey]);
- dini_FloatSet(file2,"Intrarez",HouseInfo[idx][Intrarez]);
- dini_FloatSet(file2,"Iesirex",HouseInfo[idx][Iesirex]);
- dini_FloatSet(file2,"Iesirey",HouseInfo[idx][Iesirey]);
- dini_FloatSet(file2,"Iesirez",HouseInfo[idx][Iesirez]);
- dini_IntSet(file2,"Valoare",HouseInfo[idx][Valoare]);
- dini_Set(file2,"Propietar",HouseInfo[idx][Propietar]);
- dini_IntSet(file2,"Camere",HouseInfo[idx][Camere]);
- dini_IntSet(file2,"Seif",HouseInfo[idx][Seif]);
- dini_IntSet(file2,"Cumparata",HouseInfo[idx][Cumparata]);
- dini_IntSet(file2,"Inchisa",HouseInfo[idx][Inchisa]);
- dini_IntSet(file2,"Interior",HouseInfo[idx][Interior]);
- dini_IntSet(file2,"Virtual",HouseInfo[idx][Virtual]);
- idx++;
- return 1;
- }
- }
- return 1;
- }
- public SaveThisHouse(houseid)
- {
- new file2[254];
- format(file2, sizeof(file2),"Case/%d.ini", houseid);
- if(dini_Exists(file2))
- {
- dini_FloatSet(file2,"Intrarex",HouseInfo[houseid][Intrarex]);
- dini_FloatSet(file2,"Intrarey",HouseInfo[houseid][Intrarey]);
- dini_FloatSet(file2,"Intrarez",HouseInfo[houseid][Intrarez]);
- dini_FloatSet(file2,"Iesirex",HouseInfo[houseid][Iesirex]);
- dini_FloatSet(file2,"Iesirey",HouseInfo[houseid][Iesirey]);
- dini_FloatSet(file2,"Iesirez",HouseInfo[houseid][Iesirez]);
- dini_IntSet(file2,"Valoare",HouseInfo[houseid][Valoare]);
- dini_Set(file2,"Propietar",HouseInfo[houseid][Propietar]);
- dini_IntSet(file2,"Camere",HouseInfo[houseid][Camere]);
- dini_IntSet(file2,"Seif",HouseInfo[houseid][Seif]);
- dini_IntSet(file2,"Cumparata",HouseInfo[houseid][Cumparata]);
- dini_IntSet(file2,"Inchisa",HouseInfo[houseid][Inchisa]);
- dini_IntSet(file2,"Interior",HouseInfo[houseid][Interior]);
- dini_IntSet(file2,"Virtual",HouseInfo[houseid][Virtual]);
- return 1;
- }
- else if(!dini_Exists(file2))
- {
- dini_Create(file2);
- dini_FloatSet(file2,"Intrarex",HouseInfo[houseid][Intrarex]);
- dini_FloatSet(file2,"Intrarey",HouseInfo[houseid][Intrarey]);
- dini_FloatSet(file2,"Intrarez",HouseInfo[houseid][Intrarez]);
- dini_FloatSet(file2,"Iesirex",HouseInfo[houseid][Iesirex]);
- dini_FloatSet(file2,"Iesirey",HouseInfo[houseid][Iesirey]);
- dini_FloatSet(file2,"Iesirez",HouseInfo[houseid][Iesirez]);
- dini_IntSet(file2,"Valoare",HouseInfo[houseid][Valoare]);
- dini_Set(file2,"Propietar",HouseInfo[houseid][Propietar]);
- dini_IntSet(file2,"Camere",HouseInfo[houseid][Camere]);
- dini_IntSet(file2,"Seif",HouseInfo[houseid][Seif]);
- dini_IntSet(file2,"Cumparata",HouseInfo[houseid][Cumparata]);
- dini_IntSet(file2,"Inchisa",HouseInfo[houseid][Inchisa]);
- dini_IntSet(file2,"Interior",HouseInfo[houseid][Interior]);
- dini_IntSet(file2,"Virtual",HouseInfo[houseid][Virtual]);
- return 1;
- }
- return 1;
- }
- public LoadHouses()
- {
- new file[254];
- new idx = 1;
- while(idx < sizeof(HouseInfo))
- {
- format(file, sizeof(file),"Case/%d.ini", idx);
- if(dini_Exists(file))
- {
- HouseInfo[idx][Intrarex] = dini_Float(file,"Intrarex");
- HouseInfo[idx][Intrarey] = dini_Float(file,"Intrarey");
- HouseInfo[idx][Intrarez] = dini_Float(file,"Intrarez");
- HouseInfo[idx][Iesirex] = dini_Float(file,"Iesirex");
- HouseInfo[idx][Iesirey] = dini_Float(file,"Iesirey");
- HouseInfo[idx][Iesirez] = dini_Float(file,"Iesirez");
- HouseInfo[idx][Valoare] = dini_Int(file,"Valoare");
- strmid(HouseInfo[idx][Propietar], dini_Get(file,"Propietar"), 0, strlen(dini_Get(file,"Propietar")), 255);
- HouseInfo[idx][Camere] = dini_Int(file,"Camere");
- HouseInfo[idx][Inchisa] = dini_Int(file,"Inchisa");
- HouseInfo[idx][Seif] = dini_Int(file,"Seif");
- HouseInfo[idx][Cumparata] = dini_Int(file,"Cumparata");
- HouseInfo[idx][Inchisa] = dini_Int(file,"Inchisa");
- HouseInfo[idx][Interior] = dini_Int(file,"Interior");
- HouseInfo[idx][Virtual] = dini_Int(file,"Virtual");
- idx++;
- }
- else if(!dini_Exists(file))
- {
- idx++;
- }
- }
- return 1;
- }
- public SendAdminMesaj(color,const string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(IsPlayerAdmin(i))
- {
- SendClientMessage(i, color, string);
- printf("%s", string);
- }
- }
- }
- return 1;
- }
- stock pName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- return name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement