Guest User

Untitled

a guest
Apr 9th, 2012
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.91 KB | None | 0 0
  1. #if defined VIP
  2. VIP SISTEM BY sTaRxD_
  3.  
  4. Date on 2012
  5.  
  6. #endif
  7.  
  8.  
  9.  
  10. //=======================
  11.  
  12. #include <a_samp>
  13.  
  14. #include <dini>
  15.  
  16. #include <dudb>
  17.  
  18. #include <zcmd>
  19.  
  20. #include <sscanf2>
  21.  
  22. //=======================
  23.  
  24. #pragma unused ret_memcpy
  25.  
  26. //======================
  27.  
  28. #define vip_file "vipacount/user/%s.ini"
  29.  
  30. #define vid GetPlayerVehicleID(playerid)
  31.  
  32. //==================================
  33.  
  34. enum vinfo
  35.  
  36. {
  37.  
  38. viplevel,
  39.  
  40. }
  41.  
  42. new vipinfo[MAX_PLAYERS][vinfo];
  43.  
  44. new plogin[MAX_PLAYERS];
  45.  
  46. new SV[MAX_PLAYERS];
  47.  
  48. //================================
  49.  
  50. public OnPlayerText(playerid, text[])
  51.  
  52. {
  53.  
  54. if(vipinfo[playerid][viplevel] >= 1)
  55.  
  56. {
  57.  
  58. new viptext[128];
  59.  
  60. format(viptext, 128, "{0049FF}[%d]{0049FF}[V] {FFFFFF}%s", playerid, text);
  61.  
  62. SendPlayerMessageToAll(playerid, viptext);
  63.  
  64. return 0;
  65.  
  66. }
  67.  
  68. return 1;
  69.  
  70. }
  71.  
  72.  
  73.  
  74. public OnPlayerConnect(playerid)
  75.  
  76. {
  77.  
  78. plogin[playerid] = 0;
  79.  
  80. new name[MAX_PLAYER_NAME], file[256];
  81.  
  82. GetPlayerName(playerid, name, sizeof(name));
  83.  
  84. format(file, sizeof(file), "vipacount/user/%s.ini" , name);
  85.  
  86. if (!dini_Exists(file))
  87.  
  88. {
  89.  
  90. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}register!", "{6EF83C}Introdu parola pentru contu tau de {F81414}vip\n{6EF83C}O sa fie nevoie sa te loghiezi dupa ce iesi de pe server", "Register", "Leave");
  91.  
  92. }
  93.  
  94. if(fexist(file))
  95.  
  96. {
  97.  
  98. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}Login", "{6EF83C}Introdu parola pentru a te putea loga", "Login", "Leave");
  99.  
  100. }
  101.  
  102. return 1;
  103.  
  104. }
  105.  
  106.  
  107.  
  108. CMD:vipcmds(playerid, params[])
  109.  
  110. {
  111.  
  112. new BigString[1900];
  113.  
  114. strcat(BigString, "{F81414}Level {FFFFFF}1\n", 1900 );
  115.  
  116. strcat(BigString, "{6EF83C}/vipgod\n", 1900 );
  117.  
  118. strcat(BigString, "{6EF83C}/vskin\n", 1900 );
  119.  
  120. strcat(BigString, "{6EF83C}/vcar\n\n", 1900 );
  121.  
  122. strcat(BigString, "{F81414}Level {FFFFFF}2\n", 1900 );
  123.  
  124. strcat(BigString, "{6EF83C}/viphouse\n", 1900 );
  125.  
  126. strcat(BigString, "{6EF83C}/vipmoney\n", 1900 );
  127.  
  128. strcat(BigString, "{6EF83C}/vipscore\n\n", 1900 );
  129.  
  130. strcat(BigString, "{F81414}Level {FFFFFF}3\n", 1900 );
  131.  
  132. strcat(BigString, "{6EF83C}/vipann\n", 1900 );
  133.  
  134. strcat(BigString, "{6EF83C}/vipdisarm\n", 1900 );
  135.  
  136. strcat(BigString, "{6EF83C}/vipgoto\n", 1900 );
  137.  
  138. ShowPlayerDialog(playerid, 90, DIALOG_STYLE_MSGBOX, "VipCommands", BigString, "-->oK<--","");
  139.  
  140. PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
  141.  
  142. return 1;
  143.  
  144. }
  145.  
  146. CMD:vipscore(playerid, params[])
  147.  
  148. {
  149.  
  150. new score;
  151.  
  152. if(plogin[playerid] == 1)
  153.  
  154. {
  155.  
  156. if (sscanf(params, "ii",score)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipscore {F81414}[score]");return 1;}
  157.  
  158. if(score > 1000000000)if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipann {F81414}[TEXT]");return 1;}
  159.  
  160. SetPlayerScore(playerid, score);
  161.  
  162. }
  163.  
  164. return 1;
  165.  
  166. }
  167.  
  168. CMD:viphouse(playerid, params[])
  169.  
  170. {
  171.  
  172. if(vipinfo[playerid][viplevel] < 1) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}1 {FFFFFF}pentru aceasta comanda!");
  173.  
  174. SetPlayerPos(playerid,2324.419921,-1145.568359,1050.710083);
  175.  
  176. SetPlayerInterior(playerid,12);
  177.  
  178. return 1;
  179.  
  180. }
  181.  
  182. CMD:vcar(playerid, params[])
  183.  
  184. {
  185.  
  186. if(vipinfo[playerid][viplevel] < 1) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}1 {FFFFFF}pentru aceasta comanda!");
  187.  
  188. new Float:X,Float:Y,Float:Z,Float:ppp;
  189.  
  190. GetPlayerPos(playerid,X,Y,Z);
  191.  
  192. GetPlayerFacingAngle (playerid,ppp);
  193.  
  194. SetVehicleNumberPlate(SV[playerid] = CreateVehicle(432,X,Y,Z,ppp,-1,-1,60), "{00C0FF}VIP");
  195.  
  196. PutPlayerInVehicle(playerid,SV[playerid],0);
  197.  
  198. return 1;
  199.  
  200. }
  201.  
  202. CMD:vipgoto(playerid, params[])
  203.  
  204. {
  205.  
  206. new
  207.  
  208. id,
  209.  
  210. Float:x,
  211.  
  212. Float:y,
  213.  
  214. Float:z,
  215.  
  216. vint,
  217.  
  218. str[128],
  219.  
  220. Name1[MAX_PLAYER_NAME],
  221.  
  222. Name2[MAX_PLAYER_NAME];
  223.  
  224.  
  225.  
  226. if (sscanf(params, "u", id)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipgod {F81414}[Viata]");return 1;}
  227.  
  228. else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}Playerul nu este");
  229.  
  230. if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}3 {FFFFFF}pentru aceasta comanda!"); return 1;}
  231.  
  232. else
  233.  
  234. {
  235.  
  236. if(IsPlayerInAnyVehicle(playerid) == 1)
  237.  
  238. {
  239.  
  240. GetPlayerPos(id, x , y , z);
  241.  
  242. SetVehiclePos(vid, x , y , z);
  243.  
  244. GetPlayerName(id, Name1, sizeof(Name1));
  245.  
  246. GetPlayerName(playerid, Name2, sizeof(Name2));
  247.  
  248. format(str, sizeof(str), "{FFFFFF}Vip: {00C0FF}%s {FFFFFF}sa teleportat la {00C0FF}%s ",Name2,Name1);
  249.  
  250. SendClientMessageToAll(0x38FF06FF, str);
  251.  
  252. printf(str);
  253.  
  254. }
  255.  
  256. else
  257.  
  258. {
  259.  
  260. vint = GetPlayerInterior(id);
  261.  
  262. SetPlayerInterior(playerid, vint);
  263.  
  264. GetPlayerPos(id, x , y , z);
  265.  
  266. SetPlayerPos(playerid, x , y , z);
  267.  
  268. GetPlayerName(id, Name1, sizeof(Name1));
  269.  
  270. GetPlayerName(playerid, Name2, sizeof(Name2));
  271.  
  272. format(str, sizeof(str), "{FFFFFF}Vip: {00C0FF}%s {FFFFFF}sa teleportat la {00C0FF}%s ",Name2,Name1);
  273.  
  274. SendClientMessageToAll(0x38FF06FF, str);
  275.  
  276. printf(str);
  277.  
  278. return 1;
  279.  
  280. }
  281.  
  282. }
  283.  
  284. return 1;
  285.  
  286. }
  287.  
  288. CMD:vipgod(playerid, params[])
  289.  
  290. {
  291.  
  292. new viata;
  293.  
  294. if(plogin[playerid] == 1)
  295.  
  296. {
  297.  
  298. if (sscanf(params, "ii",viata)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipgod {F81414}[Viata]");return 1;}
  299.  
  300. if(viata > 9999999999)
  301.  
  302. if(vipinfo[playerid][viplevel] < 1){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipgod {F81414}[Viata]");return 1;}
  303.  
  304. SetPlayerHealth(playerid, viata);
  305.  
  306. }
  307.  
  308. return 1;
  309.  
  310. }
  311.  
  312. CMD:vipmoney(playerid, params[])
  313.  
  314. {
  315.  
  316. new bani;
  317.  
  318. if(plogin[playerid] == 1)
  319.  
  320. {
  321.  
  322. if (sscanf(params, "ii",bani)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipmoney {F81414}[suma]");return 1;}
  323.  
  324. if(bani > 1000000000)if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipann {F81414}[TEXT]");return 1;}
  325.  
  326. GivePlayerMoney(playerid, bani);
  327.  
  328. }
  329.  
  330. return 1;
  331.  
  332. }
  333.  
  334. CMD:vskin(playerid, params[])
  335.  
  336. {
  337.  
  338. new skin;
  339.  
  340. if(sscanf(params, "i", skin)) return SendClientMessage(playerid, -1, "{FFFFFF}/vskin {F81414}[skin id]");
  341.  
  342. if(skin > 299 || skin < 0) return SendClientMessage(playerid, -1,"{FFFFFF}Nu exista skinu {F81414}ID!");
  343.  
  344. if(vipinfo[playerid][viplevel] < 1) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}1 {FFFFFF}pentru aceasta comanda!");
  345.  
  346. SetPlayerSkin(playerid, skin);
  347.  
  348. return 1;
  349.  
  350. }
  351.  
  352. CMD:vipann(playerid, params[])
  353.  
  354. {
  355.  
  356. new
  357.  
  358. string[128],
  359.  
  360. string2[128];
  361.  
  362. if (sscanf(params, "s",string2)) SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipann {F81414}[TEXT]");
  363.  
  364. if(vipinfo[playerid][viplevel] < 3) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}3 {FFFFFF}pentru aceasta comanda!");
  365.  
  366. format(string, sizeof(string),"%s", string2);
  367.  
  368. GameTextForAll(string,5000,3);
  369.  
  370. printf("Vip:");
  371.  
  372. printf(string2);
  373.  
  374. return 1;
  375.  
  376. }
  377.  
  378. CMD:vips(playerid, params[])
  379.  
  380. {
  381.  
  382. #pragma unused params
  383.  
  384. if(IsPlayerConnected(playerid))
  385.  
  386. {
  387.  
  388. for(new i = 0; i < MAX_PLAYERS; i++)
  389.  
  390. {
  391.  
  392. if(IsPlayerConnected(i))
  393.  
  394. {
  395.  
  396. new string[128],sendername[MAX_PLAYER_NAME];
  397.  
  398. GetPlayerName(i, sendername, sizeof(sendername));
  399.  
  400. if(vipinfo[i][viplevel] >= 0)
  401.  
  402. {
  403.  
  404. new vlevel[64];
  405.  
  406. if(vipinfo[playerid][viplevel] == 0) { vlevel = "Rank"; }
  407.  
  408. if(vipinfo[playerid][viplevel] == 1) { vlevel = "{FFFFFF}Vip Junior{00C0FF}[1]{FFFFFF}"; }
  409.  
  410. else if(vipinfo[playerid][viplevel] == 2) { vlevel = "{FFFFFF}Vip Gold{00C0FF}[2]{FFFFFF}"; }
  411.  
  412. else if(vipinfo[playerid][viplevel] == 3) { vlevel = "{FFFFFF}Vip premium{00C0FF}[3]{FFFFFF}"; }
  413.  
  414. format(string, sizeof(string), "{FFFFFF}%s - %s", vlevel, sendername);
  415.  
  416. ShowPlayerDialog(playerid, 1111, DIALOG_STYLE_MSGBOX, "{00C0FF}Vips", string, "-->oK<--", "");
  417.  
  418. }
  419.  
  420. }
  421.  
  422. }
  423.  
  424. }
  425.  
  426. return 1;
  427.  
  428. }
  429.  
  430. CMD:vipdisarm(playerid, params[])
  431.  
  432. {
  433.  
  434. new
  435.  
  436. id;
  437.  
  438.  
  439.  
  440. if (sscanf(params, "u", id)) SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipdisarm {F81414}[playerid]");
  441.  
  442. else if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}Pleyrul nu este conectat");
  443.  
  444. if(playerid == id) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}ERROR: Nu poti sa te dezarmezi pe tine!");
  445.  
  446. if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}3 {FFFFFF}pentru aceasta comanda!"); return 1;}
  447.  
  448. else
  449.  
  450. {
  451.  
  452. ResetPlayerWeapons(id);
  453.  
  454. SendClientMessage(id,0x38FF06FF, "{FFFFFF}Vip tea dezarmat!");
  455.  
  456. }
  457.  
  458. return 1;
  459.  
  460. }
  461.  
  462. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  463.  
  464. {
  465.  
  466. new file[256];
  467.  
  468. new string[128];
  469.  
  470. if (dialogid == 1)
  471.  
  472. {
  473.  
  474. new name[MAX_PLAYER_NAME];
  475.  
  476. GetPlayerName(playerid, name, sizeof(name));
  477.  
  478. format(file, sizeof(file), "vipacount/user/%s.ini", name);
  479.  
  480. if(!response) return Kick(playerid);
  481.  
  482. if (!strlen(inputtext)) return
  483.  
  484. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}register!", "{6EF83C}Introdu parola pentru contu tau de {F81414}vip\n{6EF83C}O sa fie nevoie sa te loghiezi dupa ce iesi de pe server", "Register", "Leave");
  485.  
  486. dini_Create(file);
  487.  
  488. dini_IntSet(file, "Password", udb_hash(inputtext));
  489.  
  490. dini_IntSet(file, "vipLevel",vipinfo[playerid][viplevel] = 0);
  491.  
  492. format(string, 128, "{FFFFFF}Nume: {00C0FF}%s\n{FFFFFF}Parola: {00C0FF}%s", name, inputtext);
  493.  
  494. ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_MSGBOX, "{6EF83C}Vip Information", string, "-->oK<--","");
  495.  
  496. plogin[playerid] = 1;
  497.  
  498. }
  499.  
  500. if (dialogid == 2)
  501.  
  502. {
  503.  
  504. new name[MAX_PLAYER_NAME];
  505.  
  506. GetPlayerName(playerid, name, sizeof(name));
  507.  
  508. format(file, sizeof(file), "vipacount/user/%s.ini", name);
  509.  
  510. if(!response) return Kick(playerid);
  511.  
  512. if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}Login", "{6EF83C}Introdu parola pentru a te putea loga", "Login", "Leave");
  513.  
  514. new tmp;
  515.  
  516. tmp = dini_Int(file, "Password");
  517.  
  518. if(udb_hash(inputtext) != tmp) {
  519.  
  520. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Wrong Password", "{F81414}Parola Gresita!", "Login", "Leave");
  521.  
  522. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}Login", "{6EF83C}Introdu parola pentru a te putea loga", "Login", "Leave");
  523.  
  524. }
  525.  
  526. else
  527.  
  528. {
  529.  
  530. plogin[playerid] = 1;
  531.  
  532. vipinfo[playerid][viplevel] = dini_Int(file, "viplevel");
  533.  
  534. SendClientMessage(playerid,0xFF444499, "{F81414}[VIP]: {FFFFFF}Acountul tau a fost activat foloseste {F81414}/vipcmds {FFFFFF}pe moment ai rank");
  535.  
  536. }
  537.  
  538. }
  539.  
  540. return 1;
  541.  
  542. }
Advertisement
Add Comment
Please, Sign In to add comment