Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:ccasa(playerid, params[]){
- if(!IsPlayerAdmin(playerid)) return SCM(playerid, GRIGIO, NOTADMIN);
- new prezzo, interior, string0[240], string1[240], id, Float:X, Float:Y, Float:Z, Float:A;
- if(sscanf(params, "ii", prezzo, interior)) return SCM(playerid, GIALLO, "/ccasa [PREZZO] [INTERIOR-ID (1-25)]");
- if(prezzo < 1) return SCM(playerid, GRIGIO, "Prezzo invalido");
- if(interior < 1 || interior > 25) return SCM(playerid, GRIGIO, "ID invalido! Interior ID [1-25]");
- for(new h = 1;h < sizeof(hInfo); h++){
- if(hInfo[h][hPrezzo] == 0){
- id = h;
- break;}}
- hInfo[id][hPosX] = X;
- hInfo[id][hPosY] = Y;
- hInfo[id][hPosZ] = Z;
- GetPlayerPos(playerid, X,Y,Z);
- GetPlayerFacingAngle(playerid, A);
- hInfo[id][hPrezzo] = prezzo;
- hInfo[id][hComprato] = 0;
- hInfo[id][hPosX] = X;
- hInfo[id][hPosY] = Y;
- hInfo[id][hPosZ] = Z;
- hInfo[id][hPosA] = A;
- hInfo[id][hInterior] = interior;
- hInfo[id][hVirtualWorld] = id;
- hInfo[id][hIcon] = CreateDynamicPickup(1273, 1, hInfo[id][hPosX], hInfo[id][hPosY], hInfo[id][hPosZ],0);
- format(string0, sizeof(string0), "Nessuno");
- strmid(hInfo[id][hProprietario], string0, 0, strlen(string0), 255);
- format(string1, sizeof(string1), "Casa[ID:%d]\nProprietario: %s\nPrezzo: %d\n Per comprare premi Y", id, hInfo[id][hProprietario], hInfo[id][hPrezzo]);
- hlabel[id] = CreateDynamic3DTextLabel(string1, GIALLO, hInfo[id][hPosX], hInfo[id][hPosY], hInfo[id][hPosZ], 3.0, INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0);
- //==Save Interior===============================================================
- if(hInfo[id][hInterior] == 1){//ryder 2
- hInfo[id][hIntID] = 2;
- hInfo[id][hPosXX] = 2466.3015;
- hInfo[id][hPosYY] = -1698.5970;
- hInfo[id][hPosZZ] = 1013.507;}
- else if(hInfo[id][hInterior] == 2){//CJ's 3
- hInfo[id][hIntID] = 3;
- hInfo[id][hPosXX] = 2495.7905;
- hInfo[id][hPosYY] = -1694.3346;
- hInfo[id][hPosZZ] = 1014.7422;}
- else if(hInfo[id][hInterior] == 3){//wuzimu 1
- hInfo[id][hIntID] = 1;
- hInfo[id][hPosXX] = -2167.8662;
- hInfo[id][hPosYY] = 642.4196;
- hInfo[id][hPosZZ] = 1057.5938;}
- else if(hInfo[id][hInterior] == 4){//safehouse group 1
- hInfo[id][hIntID] = 1;
- hInfo[id][hPosXX] = 2233.6919;
- hInfo[id][hPosYY] = -1112.8107;
- hInfo[id][hPosZZ] = 1050.8828;}
- else if(hInfo[id][hInterior] == 5){//safehouse group 3
- hInfo[id][hIntID] = 3;
- hInfo[id][hPosXX] = 2319.1255;
- hInfo[id][hPosYY] = -1023.9523;
- hInfo[id][hPosZZ] = 1050.2109;}
- else if(hInfo[id][hInterior] == 6){//safehouse group 4
- hInfo[id][hIntID] = 4;
- hInfo[id][hPosXX] = 2259.4136;
- hInfo[id][hPosYY] = -1136.4128;
- hInfo[id][hPosZZ] = 1050.6403;}
- else if(hInfo[id][hInterior] == 7){// budget inn motel room 12
- hInfo[id][hIntID] = 12;
- hInfo[id][hPosXX] = 446.3247;
- hInfo[id][hPosYY] = 509.9662;
- hInfo[id][hPosZZ] = 1001.4195;}
- else if(hInfo[id][hInterior] == 8){// pair of uburlgar houses 2
- hInfo[id][hIntID] = 2;
- hInfo[id][hPosXX] = 447.1108;
- hInfo[id][hPosYY] = 1399.5410;
- hInfo[id][hPosZZ] = 1084.3047;}
- else if(hInfo[id][hInterior] == 9){// burlglary house x11 5
- hInfo[id][hIntID] = 5;
- hInfo[id][hPosXX] = 229.1724;
- hInfo[id][hPosYY] = 1114.5135;
- hInfo[id][hPosZZ] = 1080.9922;}
- else if(hInfo[id][hInterior] == 10){// burlglary house x12 4
- hInfo[id][hIntID] = 4;
- hInfo[id][hPosXX] = 261.5108;
- hInfo[id][hPosYY] = 1286.0137;
- hInfo[id][hPosZZ] = 1080.2578;}
- else if(hInfo[id][hInterior] == 11){// burlglary house x14 10
- hInfo[id][hIntID] = 10;
- hInfo[id][hPosXX] = 24.3769;
- hInfo[id][hPosYY] = 1341.1829;
- hInfo[id][hPosZZ] = 1084.3750;}
- else if(hInfo[id][hInterior] == 12){// burlglary house x13 4
- hInfo[id][hIntID] = 4;
- hInfo[id][hPosXX] = 221.6766;
- hInfo[id][hPosYY] = 1142.4962;
- hInfo[id][hPosZZ] = 1082.6094;}
- else if(hInfo[id][hInterior] == 13){// villona 12
- hInfo[id][hIntID] = 12;
- hInfo[id][hPosXX] = 2324.2932;
- hInfo[id][hPosYY] = -1148.6160;
- hInfo[id][hPosZZ] = 1050.7101;}
- else if(hInfo[id][hInterior] == 14){// bulgrrg house x15 4
- hInfo[id][hIntID] = 4;
- hInfo[id][hPosXX] = -262.0143;
- hInfo[id][hPosYY] = 1456.4313;
- hInfo[id][hPosZZ] = 1084.3672;}
- else if(hInfo[id][hInterior] == 15){// bulgrrg house x16 5
- hInfo[id][hIntID] = 5;
- hInfo[id][hPosXX] = 22.6792;
- hInfo[id][hPosYY] = 1405.1183;
- hInfo[id][hPosZZ] = 1084.4297;}
- else if(hInfo[id][hInterior] == 16){// bulgrrg house x17 enorme da mappare 5
- hInfo[id][hIntID] = 5;
- hInfo[id][hPosXX] = 140.4665;
- hInfo[id][hPosYY] = 1368.1595;
- hInfo[id][hPosZZ] = 1083.8625;}
- else if(hInfo[id][hInterior] == 17){// bulgrrg house x18 6
- hInfo[id][hIntID] = 6;
- hInfo[id][hPosXX] = 234.2826;
- hInfo[id][hPosYY] = 1065.2290;
- hInfo[id][hPosZZ] = 1084.2101;}
- else if(hInfo[id][hInterior] == 18){// bulgrrg house x19 6
- hInfo[id][hIntID] = 6;
- hInfo[id][hPosXX] = -68.2355;
- hInfo[id][hPosYY] = 1353.9028;
- hInfo[id][hPosZZ] = 1080.2109;}
- else if(hInfo[id][hInterior] == 19){// bulgrrg house x20 15
- hInfo[id][hIntID] = 15;
- hInfo[id][hPosXX] = -285.4269;
- hInfo[id][hPosYY] = 1470.9344;
- hInfo[id][hPosZZ] = 1084.3750;}
- else if(hInfo[id][hInterior] == 20){// caligula's roof 1
- hInfo[id][hIntID] = 1;
- hInfo[id][hPosXX] = 2215.4458;
- hInfo[id][hPosYY] = -1076.7493;
- hInfo[id][hPosZZ] = 1050.4844;}
- else if(hInfo[id][hInterior] == 21){// old venturas strip casino 2
- hInfo[id][hIntID] = 2;
- hInfo[id][hPosXX] = 2236.8916;
- hInfo[id][hPosYY] = -1078.7402;
- hInfo[id][hPosZZ] = 1049.0234;}
- else if(hInfo[id][hInterior] == 22){// verdant bluffs safehouse 8
- hInfo[id][hIntID] = 8;
- hInfo[id][hPosXX] = 2365.1089;
- hInfo[id][hPosYY] = -1133.0795;
- hInfo[id][hPosZZ] = 1050.8750;}
- else if(hInfo[id][hInterior] == 23){// burgr x21 8
- hInfo[id][hIntID] = 8;
- hInfo[id][hPosXX] = -42.7078;
- hInfo[id][hPosYY] = 1406.8553;
- hInfo[id][hPosZZ] = 1084.4297;}
- else if(hInfo[id][hInterior] == 24){// burgr x22 9
- hInfo[id][hIntID] = 9;
- hInfo[id][hPosXX] = 84.9231;
- hInfo[id][hPosYY] = 1324.3130;
- hInfo[id][hPosZZ] = 1083.8594;}
- else if(hInfo[id][hInterior] == 25){// burgr x23 9
- hInfo[id][hIntID] = 9;
- hInfo[id][hPosXX] = 260.5242;
- hInfo[id][hPosYY] = 1238.9857;
- hInfo[id][hPosZZ] = 1084.2578;}
- //===CREA IL FILE DELLA CASA===//
- new file4[403];
- format(file4, sizeof(file4), HPATH, id);
- new INI:File = INI_Open(file4);
- INI_SetTag(File,"data");
- INI_WriteString(File,"Proprietario", hInfo[id][hProprietario]);
- INI_WriteInt(File,"Comprato", hInfo[id][hComprato]);
- INI_WriteInt(File,"Prezzo", hInfo[id][hPrezzo]);
- INI_WriteInt(File,"Interior", hInfo[id][hInterior]);
- INI_WriteInt(File,"VirtualWorld", hInfo[id][hVirtualWorld]);
- INI_WriteInt(File,"IntID", hInfo[id][hIntID]);
- INI_WriteFloat(File,"PosX", hInfo[id][hPosX]);
- INI_WriteFloat(File,"PosY", hInfo[id][hPosY]);
- INI_WriteFloat(File,"PosZ", hInfo[id][hPosZ]);
- INI_WriteFloat(File,"PosA", hInfo[id][hPosA]);
- INI_WriteFloat(File,"PosXX", hInfo[id][hPosXX]);
- INI_WriteFloat(File,"PosYY", hInfo[id][hPosYY]);
- INI_WriteFloat(File,"PosZZ", hInfo[id][hPosZZ]);
- INI_WriteFloat(File,"PosAA", hInfo[id][hPosAA]);
- INI_WriteInt(File,"Cassa", 0);
- INI_Close(File);
- return 1;
- }
- if(newkeys & KEY_SECONDARY_ATTACK && IsPlayerNearHomeEnt(playerid)){//ENTRA
- new id = IsPlayerNearHomeEnt(playerid);
- SetPlayerVirtualWorld(playerid, hInfo[id][hVirtualWorld]);
- SetPlayerInterior(playerid, hInfo[id][hIntID]);
- SetPlayerPos(playerid, hInfo[id][hPosXX], hInfo[id][hPosYY], hInfo[id][hPosZZ]);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement