Advertisement
BlooDMasK

Untitled

Jul 19th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.32 KB | None | 0 0
  1. CMD:ccasa(playerid, params[]){
  2.  
  3.  
  4.     if(!IsPlayerAdmin(playerid)) return SCM(playerid, GRIGIO, NOTADMIN);
  5.     new prezzo, interior, string0[240], string1[240], id, Float:X, Float:Y, Float:Z, Float:A;
  6.     if(sscanf(params, "ii", prezzo, interior)) return SCM(playerid, GIALLO, "/ccasa [PREZZO] [INTERIOR-ID (1-25)]");
  7.     if(prezzo < 1) return SCM(playerid, GRIGIO, "Prezzo invalido");
  8.     if(interior < 1 || interior > 25) return SCM(playerid, GRIGIO, "ID invalido! Interior ID [1-25]");
  9.     for(new h = 1;h < sizeof(hInfo); h++){
  10.     if(hInfo[h][hPrezzo] == 0){
  11.     id = h;
  12.     break;}}
  13.     hInfo[id][hPosX] = X;
  14.     hInfo[id][hPosY] = Y;
  15.     hInfo[id][hPosZ] = Z;
  16.     GetPlayerPos(playerid, X,Y,Z);
  17.     GetPlayerFacingAngle(playerid, A);
  18.     hInfo[id][hPrezzo] = prezzo;
  19.     hInfo[id][hComprato] = 0;
  20.     hInfo[id][hPosX] = X;
  21.     hInfo[id][hPosY] = Y;
  22.     hInfo[id][hPosZ] = Z;
  23.     hInfo[id][hPosA] = A;
  24.     hInfo[id][hInterior] = interior;
  25.     hInfo[id][hVirtualWorld] = id;
  26.     hInfo[id][hIcon] = CreateDynamicPickup(1273, 1, hInfo[id][hPosX], hInfo[id][hPosY], hInfo[id][hPosZ],0);
  27.     format(string0, sizeof(string0), "Nessuno");
  28.     strmid(hInfo[id][hProprietario], string0, 0, strlen(string0), 255);
  29.  
  30.     format(string1, sizeof(string1), "Casa[ID:%d]\nProprietario: %s\nPrezzo: %d\n Per comprare premi Y", id, hInfo[id][hProprietario], hInfo[id][hPrezzo]);
  31.     hlabel[id] = CreateDynamic3DTextLabel(string1, GIALLO, hInfo[id][hPosX], hInfo[id][hPosY], hInfo[id][hPosZ], 3.0, INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0);
  32.  
  33. //==Save Interior===============================================================
  34.  
  35.     if(hInfo[id][hInterior] == 1){//ryder 2
  36.     hInfo[id][hIntID] = 2;
  37.     hInfo[id][hPosXX] = 2466.3015;
  38.     hInfo[id][hPosYY] = -1698.5970;
  39.     hInfo[id][hPosZZ] = 1013.507;}
  40.  
  41.     else if(hInfo[id][hInterior] == 2){//CJ's 3
  42.     hInfo[id][hIntID] = 3;
  43.     hInfo[id][hPosXX] = 2495.7905;
  44.     hInfo[id][hPosYY] = -1694.3346;
  45.     hInfo[id][hPosZZ] = 1014.7422;}
  46.  
  47.     else if(hInfo[id][hInterior] == 3){//wuzimu 1
  48.     hInfo[id][hIntID] = 1;
  49.     hInfo[id][hPosXX] = -2167.8662;
  50.     hInfo[id][hPosYY] = 642.4196;
  51.     hInfo[id][hPosZZ] = 1057.5938;}
  52.  
  53.     else if(hInfo[id][hInterior] == 4){//safehouse group 1
  54.     hInfo[id][hIntID] = 1;
  55.     hInfo[id][hPosXX] = 2233.6919;
  56.     hInfo[id][hPosYY] = -1112.8107;
  57.     hInfo[id][hPosZZ] = 1050.8828;}
  58.  
  59.     else if(hInfo[id][hInterior] == 5){//safehouse group 3
  60.     hInfo[id][hIntID] = 3;
  61.     hInfo[id][hPosXX] = 2319.1255;
  62.     hInfo[id][hPosYY] = -1023.9523;
  63.     hInfo[id][hPosZZ] = 1050.2109;}
  64.  
  65.     else if(hInfo[id][hInterior] == 6){//safehouse group 4
  66.     hInfo[id][hIntID] = 4;
  67.     hInfo[id][hPosXX] = 2259.4136;
  68.     hInfo[id][hPosYY] = -1136.4128;
  69.     hInfo[id][hPosZZ] = 1050.6403;}
  70.  
  71.     else if(hInfo[id][hInterior] == 7){// budget inn motel room 12
  72.     hInfo[id][hIntID] = 12;
  73.     hInfo[id][hPosXX] = 446.3247;
  74.     hInfo[id][hPosYY] = 509.9662;
  75.     hInfo[id][hPosZZ] = 1001.4195;}
  76.  
  77.     else if(hInfo[id][hInterior] == 8){// pair of uburlgar houses 2
  78.     hInfo[id][hIntID] = 2;
  79.     hInfo[id][hPosXX] = 447.1108;
  80.     hInfo[id][hPosYY] = 1399.5410;
  81.     hInfo[id][hPosZZ] = 1084.3047;}
  82.  
  83.     else if(hInfo[id][hInterior] == 9){// burlglary house x11 5
  84.     hInfo[id][hIntID] = 5;
  85.     hInfo[id][hPosXX] = 229.1724;
  86.     hInfo[id][hPosYY] = 1114.5135;
  87.     hInfo[id][hPosZZ] = 1080.9922;}
  88.  
  89.     else if(hInfo[id][hInterior] == 10){// burlglary house x12 4
  90.     hInfo[id][hIntID] = 4;
  91.     hInfo[id][hPosXX] = 261.5108;
  92.     hInfo[id][hPosYY] = 1286.0137;
  93.     hInfo[id][hPosZZ] = 1080.2578;}
  94.  
  95.     else if(hInfo[id][hInterior] == 11){// burlglary house x14 10
  96.     hInfo[id][hIntID] = 10;
  97.     hInfo[id][hPosXX] = 24.3769;
  98.     hInfo[id][hPosYY] = 1341.1829;
  99.     hInfo[id][hPosZZ] = 1084.3750;}
  100.  
  101.     else if(hInfo[id][hInterior] == 12){// burlglary house x13 4
  102.     hInfo[id][hIntID] = 4;
  103.     hInfo[id][hPosXX] = 221.6766;
  104.     hInfo[id][hPosYY] = 1142.4962;
  105.     hInfo[id][hPosZZ] = 1082.6094;}
  106.  
  107.     else if(hInfo[id][hInterior] == 13){// villona 12
  108.     hInfo[id][hIntID] = 12;
  109.     hInfo[id][hPosXX] = 2324.2932;
  110.     hInfo[id][hPosYY] = -1148.6160;
  111.     hInfo[id][hPosZZ] = 1050.7101;}
  112.  
  113.     else if(hInfo[id][hInterior] == 14){// bulgrrg house x15 4
  114.     hInfo[id][hIntID] = 4;
  115.     hInfo[id][hPosXX] = -262.0143;
  116.     hInfo[id][hPosYY] = 1456.4313;
  117.     hInfo[id][hPosZZ] = 1084.3672;}
  118.  
  119.     else if(hInfo[id][hInterior] == 15){// bulgrrg house x16 5
  120.     hInfo[id][hIntID] = 5;
  121.     hInfo[id][hPosXX] = 22.6792;
  122.     hInfo[id][hPosYY] = 1405.1183;
  123.     hInfo[id][hPosZZ] = 1084.4297;}
  124.  
  125.     else if(hInfo[id][hInterior] == 16){// bulgrrg house x17 enorme da mappare 5
  126.     hInfo[id][hIntID] = 5;
  127.     hInfo[id][hPosXX] = 140.4665;
  128.     hInfo[id][hPosYY] = 1368.1595;
  129.     hInfo[id][hPosZZ] = 1083.8625;}
  130.  
  131.     else if(hInfo[id][hInterior] == 17){// bulgrrg house x18 6
  132.     hInfo[id][hIntID] = 6;
  133.     hInfo[id][hPosXX] = 234.2826;
  134.     hInfo[id][hPosYY] = 1065.2290;
  135.     hInfo[id][hPosZZ] = 1084.2101;}
  136.  
  137.     else if(hInfo[id][hInterior] == 18){// bulgrrg house x19 6
  138.     hInfo[id][hIntID] = 6;
  139.     hInfo[id][hPosXX] = -68.2355;
  140.     hInfo[id][hPosYY] = 1353.9028;
  141.     hInfo[id][hPosZZ] = 1080.2109;}
  142.  
  143.     else if(hInfo[id][hInterior] == 19){// bulgrrg house x20 15
  144.     hInfo[id][hIntID] = 15;
  145.     hInfo[id][hPosXX] = -285.4269;
  146.     hInfo[id][hPosYY] = 1470.9344;
  147.     hInfo[id][hPosZZ] = 1084.3750;}
  148.  
  149.     else if(hInfo[id][hInterior] == 20){// caligula's roof 1
  150.     hInfo[id][hIntID] = 1;
  151.     hInfo[id][hPosXX] = 2215.4458;
  152.     hInfo[id][hPosYY] = -1076.7493;
  153.     hInfo[id][hPosZZ] = 1050.4844;}
  154.  
  155.     else if(hInfo[id][hInterior] == 21){// old venturas strip casino 2
  156.     hInfo[id][hIntID] = 2;
  157.     hInfo[id][hPosXX] = 2236.8916;
  158.     hInfo[id][hPosYY] = -1078.7402;
  159.     hInfo[id][hPosZZ] = 1049.0234;}
  160.  
  161.     else if(hInfo[id][hInterior] == 22){// verdant bluffs safehouse 8
  162.     hInfo[id][hIntID] = 8;
  163.     hInfo[id][hPosXX] = 2365.1089;
  164.     hInfo[id][hPosYY] = -1133.0795;
  165.     hInfo[id][hPosZZ] = 1050.8750;}
  166.  
  167.     else if(hInfo[id][hInterior] == 23){// burgr x21 8
  168.     hInfo[id][hIntID] = 8;
  169.     hInfo[id][hPosXX] = -42.7078;
  170.     hInfo[id][hPosYY] = 1406.8553;
  171.     hInfo[id][hPosZZ] = 1084.4297;}
  172.  
  173.     else if(hInfo[id][hInterior] == 24){// burgr x22 9
  174.     hInfo[id][hIntID] = 9;
  175.     hInfo[id][hPosXX] = 84.9231;
  176.     hInfo[id][hPosYY] = 1324.3130;
  177.     hInfo[id][hPosZZ] = 1083.8594;}
  178.  
  179.     else if(hInfo[id][hInterior] == 25){// burgr x23 9
  180.     hInfo[id][hIntID] = 9;
  181.     hInfo[id][hPosXX] = 260.5242;
  182.     hInfo[id][hPosYY] = 1238.9857;
  183.     hInfo[id][hPosZZ] = 1084.2578;}
  184.  
  185.     //===CREA IL FILE DELLA CASA===//
  186.     new file4[403];
  187.     format(file4, sizeof(file4), HPATH, id);
  188.     new INI:File = INI_Open(file4);
  189.     INI_SetTag(File,"data");
  190.     INI_WriteString(File,"Proprietario", hInfo[id][hProprietario]);
  191.     INI_WriteInt(File,"Comprato", hInfo[id][hComprato]);
  192.     INI_WriteInt(File,"Prezzo", hInfo[id][hPrezzo]);
  193.     INI_WriteInt(File,"Interior", hInfo[id][hInterior]);
  194.     INI_WriteInt(File,"VirtualWorld", hInfo[id][hVirtualWorld]);
  195.     INI_WriteInt(File,"IntID", hInfo[id][hIntID]);
  196.     INI_WriteFloat(File,"PosX", hInfo[id][hPosX]);
  197.     INI_WriteFloat(File,"PosY", hInfo[id][hPosY]);
  198.     INI_WriteFloat(File,"PosZ", hInfo[id][hPosZ]);
  199.     INI_WriteFloat(File,"PosA", hInfo[id][hPosA]);
  200.     INI_WriteFloat(File,"PosXX", hInfo[id][hPosXX]);
  201.     INI_WriteFloat(File,"PosYY", hInfo[id][hPosYY]);
  202.     INI_WriteFloat(File,"PosZZ", hInfo[id][hPosZZ]);
  203.     INI_WriteFloat(File,"PosAA", hInfo[id][hPosAA]);
  204.     INI_WriteInt(File,"Cassa", 0);
  205.     INI_Close(File);
  206.     return 1;
  207. }
  208.  
  209.     if(newkeys & KEY_SECONDARY_ATTACK && IsPlayerNearHomeEnt(playerid)){//ENTRA
  210.     new id = IsPlayerNearHomeEnt(playerid);
  211.     SetPlayerVirtualWorld(playerid, hInfo[id][hVirtualWorld]);
  212.     SetPlayerInterior(playerid, hInfo[id][hIntID]);
  213.     SetPlayerPos(playerid, hInfo[id][hPosXX], hInfo[id][hPosYY], hInfo[id][hPosZZ]);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement