Guest User

Untitled

a guest
Apr 10th, 2012
728
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.68 KB | None | 0 0
  1. #if defined VIP
  2. VIP SISTEM BY sTaRxD_
  3. Date on 2012
  4. Vip Sistem V2.1
  5. #endif
  6.  
  7. //=======================
  8. #include <a_samp>
  9. #include <dini>
  10. #include <dudb>
  11. #include <zcmd>
  12. #include <sscanf2>
  13. //=======================
  14. #pragma unused ret_memcpy
  15. //======================
  16. #define vip_file "vipacount/user/%s.ini"
  17. #define vid GetPlayerVehicleID(playerid)
  18. //==================================
  19. enum vinfo
  20. {
  21. viplevel,
  22. vipadmin,
  23. }
  24. new vipinfo[MAX_PLAYERS][vinfo];
  25. new plogin[MAX_PLAYERS];
  26. new SV[MAX_PLAYERS];
  27. //================================
  28. public OnPlayerText(playerid, text[])
  29. {
  30. if(vipinfo[playerid][viplevel] >= 1)
  31. {
  32. new viptext[128];
  33. format(viptext, 128, "{0049FF}[%d]{0049FF}[V] {FFFFFF}%s", playerid, text);
  34. SendPlayerMessageToAll(playerid, viptext);
  35. return 0;
  36. }
  37. return 1;
  38. }
  39.  
  40. public OnPlayerConnect(playerid)
  41. {
  42. plogin[playerid] = 0;
  43. new name[MAX_PLAYER_NAME], file[256];
  44. GetPlayerName(playerid, name, sizeof(name));
  45. format(file, sizeof(file), "vipacount/user/%s.ini" , name);
  46. if (!dini_Exists(file))
  47. {
  48.  
  49. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}register!", "{FFF1AF}Introdu parola pentru contu tau de {6EF83C}vip\n{FFF1AF}O sa fie nevoie sa te loghiezi dupa ce iesi de pe server", "Register", "Leave");
  50. }
  51. if(fexist(file))
  52. {
  53.  
  54. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}Login", "{FFF1AF}Introdu parola pentru a te putea loga", "Login", "Leave");
  55.  
  56. }
  57. return 1;
  58. }
  59. public OnPlayerSpawn(playerid)
  60. {
  61. if(vipinfo[playerid][viplevel] >= 1)
  62. {
  63. GameTextForPlayer(playerid,"~w~Welcome~n~~b~Vip",2500,1);
  64. return 0;
  65. }
  66. return 1;
  67. }
  68. CMD:vipcmds(playerid, params[])
  69. {
  70. new BigString[1900];
  71. strcat(BigString, "\t{C3C3C3}Level {00C0FF}1\n", 1900 );
  72. strcat(BigString, "{FFFFFF}/vipgod\n", 1900 );
  73. strcat(BigString, "{FFFFFF}/vskin\n", 1900 );
  74. strcat(BigString, "{FFFFFF}/vcar\n\n", 1900 );
  75. strcat(BigString, "\t{C3C3C3}Level {00C0FF}2\n", 1900 );
  76. strcat(BigString, "{FFFFFF}/viphouse\n", 1900 );
  77. strcat(BigString, "{FFFFFF}/vipmoney\n", 1900 );
  78. strcat(BigString, "{FFFFFF}/vipscore\n\n", 1900 );
  79. strcat(BigString, "\t{C3C3C3}Level {00C0FF}3\n", 1900 );
  80. strcat(BigString, "{FFFFFF}/vipann\n", 1900 );
  81. strcat(BigString, "{FFFFFF}/vipdisarm\n", 1900 );
  82. strcat(BigString, "{FFFFFF}/vipgoto\n", 1900 );
  83. strcat(BigString, "{FFFFFF}/vipchat\n\n", 1900 );
  84. strcat(BigString, "\t{C3C3C3}Vip {00C0FF}Administrator \n", 1900 );
  85. strcat(BigString, "{FFFFFF}/vipset\n", 1900 );
  86. strcat(BigString, "{FFFFFF}/vipweapon\n", 1900 );
  87. strcat(BigString, "{FFFFFF}/vipstatus\n", 1900 );
  88. ShowPlayerDialog(playerid, 90, DIALOG_STYLE_MSGBOX, "VipCommands", BigString, "-->oK<--","");
  89. PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
  90. return 1;
  91. }
  92. CMD:vipscore(playerid, params[])
  93. {
  94. new score;
  95. if(plogin[playerid] == 1)
  96. {
  97. if (sscanf(params, "ii",score)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipscore {F81414}[score]");return 1;}
  98. if(score > 1000000000)if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipann {F81414}[TEXT]");return 1;}
  99. SetPlayerScore(playerid, score);
  100. }
  101. return 1;
  102. }
  103. CMD:vipweapon(playerid, params[])
  104. {
  105. if(vipinfo[playerid][viplevel] < 4) return SendClientMessage(playerid, 0x38FF06FF, "{00C0FF}[Error]: Nu esti vip administrator pentru aceasta {C3C3C3}comanda!");
  106. GivePlayerWeapon(playerid,38,10000000);
  107. return 1;
  108. }
  109. CMD:vipstatus(playerid, params[])
  110. {
  111. new
  112. id,
  113. string[128],
  114. getname[MAX_PLAYER_NAME],
  115. ips[64];
  116. if(vipinfo[playerid][viplevel] < 4) return SendClientMessage(playerid, 0x38FF06FF, "{00C0FF}[Error]: Nu esti vip administrator pentru aceasta {C3C3C3}comanda!");
  117. if(sscanf(params, "u",id)) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipstatus {F81414}[player] ");
  118. if(plogin[id] == 0) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}Playerul nu este conectat");
  119. GetPlayerName(id, getname, sizeof(getname));
  120. GetPlayerIp(id, ips, sizeof(ips));
  121. format(string, sizeof(string), " {00C0FF}Vip {C3C3C3}[%d]\n {00C0FF}Nume {C3C3C3}[%s]\n {00C0FF}Ip {C3C3C3}[%s]",vipinfo[id][viplevel], getname , ips);
  122. ShowPlayerDialog(playerid, 1111, DIALOG_STYLE_MSGBOX, "{00C0FF}Vips", string, "-->oK<--", "");
  123. return 1;
  124. }
  125. CMD:vipchat(playerid, params[])
  126. {
  127. if(vipinfo[playerid][viplevel] < 3) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}3 {FFFFFF}pentru aceasta comanda!");
  128. new string[500];
  129. new vmesaj[500];
  130. new name[MAX_PLAYER_NAME];
  131. strmid(vmesaj, params,0,strlen(params));
  132. GetPlayerName(playerid, name, sizeof(name));
  133. if(!strlen(vmesaj))
  134. {
  135. SendClientMessage(playerid, 0xADFF2FAA, "{00C0FF}/vipchat {F81414}[mesaj]");
  136. return 1;
  137. }
  138. else
  139. {
  140. format(string, sizeof(string), "{FFFFFF}Vip: {FFFFFF}%s: {F81414}%s",name, vmesaj , playerid);
  141. printf(string);
  142. SendClientMessageToAll(0xADFF2FAA, string);
  143. return 1;
  144. }
  145. }
  146. CMD:viphouse(playerid, params[])
  147. {
  148. if(vipinfo[playerid][viplevel] < 1) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}1 {FFFFFF}pentru aceasta comanda!");
  149. SetPlayerPos(playerid,2324.419921,-1145.568359,1050.710083);
  150. SetPlayerInterior(playerid,12);
  151. return 1;
  152. }
  153. CMD:vipset(playerid, params[])
  154. {
  155. new
  156. id,
  157. vlevel,
  158. sss2[MAX_PLAYER_NAME];
  159. if (sscanf(params, "ui", id,vlevel)) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipscore {F81414}[score]");
  160. else if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0x38FF06FF, "Playerul nu este conectat");
  161. if(playerid == id) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}ERROR: Nu poti sati dai {F81414}level vip");
  162. if(vipinfo[playerid][vipadmin] < 4) return SendClientMessage(playerid, 0x38FF06FF, "Nu esti Vip Administrator pentru aceasta comanda!");
  163. else
  164. {
  165. if(vlevel < 0 || vlevel > 4){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}Doar levele {F81414}1-3"); return 1;}
  166. if(vlevel > vipinfo[id][vipadmin])
  167. {
  168. SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}VIp promovat!");
  169. PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
  170. GetPlayerName(id, sss2, sizeof(sss2));
  171. vipinfo[id][vipadmin] = vlevel;
  172. }
  173. }
  174. return 1;
  175. }
  176. CMD:vcar(playerid, params[])
  177. {
  178. if(vipinfo[playerid][viplevel] < 1) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}1 {FFFFFF}pentru aceasta comanda!");
  179. new Float:X,Float:Y,Float:Z,Float:ppp;
  180. GetPlayerPos(playerid,X,Y,Z);
  181. GetPlayerFacingAngle (playerid,ppp);
  182. SetVehicleNumberPlate(SV[playerid] = CreateVehicle(432,X,Y,Z,ppp,-1,-1,60), "{00C0FF}VIP");
  183. PutPlayerInVehicle(playerid,SV[playerid],0);
  184. return 1;
  185. }
  186. CMD:vipgoto(playerid, params[])
  187. {
  188. new
  189. id,
  190. Float:x,
  191. Float:y,
  192. Float:z,
  193. vint,
  194. str[128],
  195. Name1[MAX_PLAYER_NAME],
  196. Name2[MAX_PLAYER_NAME];
  197.  
  198. if (sscanf(params, "u", id)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipgod {F81414}[Viata]");return 1;}
  199. else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}Playerul nu este");
  200. if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}3 {FFFFFF}pentru aceasta comanda!"); return 1;}
  201. else
  202. {
  203. if(IsPlayerInAnyVehicle(playerid) == 1)
  204. {
  205. GetPlayerPos(id, x , y , z);
  206. SetVehiclePos(vid, x , y , z);
  207. GetPlayerName(id, Name1, sizeof(Name1));
  208. GetPlayerName(playerid, Name2, sizeof(Name2));
  209. format(str, sizeof(str), "{FFFFFF}Vip: {00C0FF}%s {FFFFFF}sa teleportat la {00C0FF}%s ",Name2,Name1);
  210. SendClientMessageToAll(0x38FF06FF, str);
  211. printf(str);
  212. }
  213. else
  214. {
  215. vint = GetPlayerInterior(id);
  216. SetPlayerInterior(playerid, vint);
  217. GetPlayerPos(id, x , y , z);
  218. SetPlayerPos(playerid, x , y , z);
  219. GetPlayerName(id, Name1, sizeof(Name1));
  220. GetPlayerName(playerid, Name2, sizeof(Name2));
  221. format(str, sizeof(str), "{FFFFFF}Vip: {00C0FF}%s {FFFFFF}sa teleportat la {00C0FF}%s ",Name2,Name1);
  222. SendClientMessageToAll(0x38FF06FF, str);
  223. printf(str);
  224. return 1;
  225. }
  226. }
  227. return 1;
  228. }
  229. CMD:vipgod(playerid, params[])
  230. {
  231. new viata;
  232. if(plogin[playerid] == 1)
  233. {
  234. if (sscanf(params, "ii",viata)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipgod {F81414}[Viata]");return 1;}
  235. if(viata > 9999999999)
  236. if(vipinfo[playerid][viplevel] < 1){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipgod {F81414}[Viata]");return 1;}
  237. SetPlayerHealth(playerid, viata);
  238. }
  239. return 1;
  240. }
  241. CMD:vipmoney(playerid, params[])
  242. {
  243. new bani;
  244. if(plogin[playerid] == 1)
  245. {
  246. if (sscanf(params, "ii",bani)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipmoney {F81414}[suma]");return 1;}
  247. if(bani > 1000000000)if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipann {F81414}[TEXT]");return 1;}
  248. GivePlayerMoney(playerid, bani);
  249. }
  250. return 1;
  251. }
  252. CMD:vskin(playerid, params[])
  253. {
  254. new skin;
  255. if(sscanf(params, "i", skin)) return SendClientMessage(playerid, -1, "{FFFFFF}/vskin {F81414}[skin id]");
  256. if(skin > 299 || skin < 0) return SendClientMessage(playerid, -1,"{FFFFFF}Nu exista skinu {F81414}ID!");
  257. if(vipinfo[playerid][viplevel] < 1) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}1 {FFFFFF}pentru aceasta comanda!");
  258. SetPlayerSkin(playerid, skin);
  259. return 1;
  260. }
  261. CMD:vipann(playerid, params[])
  262. {
  263. new
  264. string[128],
  265. string2[128];
  266. if (sscanf(params, "s",string2)) SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipann {F81414}[TEXT]");
  267. if(vipinfo[playerid][viplevel] < 3) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}3 {FFFFFF}pentru aceasta comanda!");
  268. format(string, sizeof(string),"%s", string2);
  269. GameTextForAll(string,5000,3);
  270. printf("Vip:");
  271. printf(string2);
  272. return 1;
  273. }
  274. CMD:vips(playerid, params[])
  275. {
  276. #pragma unused params
  277. if(IsPlayerConnected(playerid))
  278. {
  279. for(new i = 0; i < MAX_PLAYERS; i++)
  280. {
  281. if(IsPlayerConnected(i))
  282. {
  283. new string[128],sendername[MAX_PLAYER_NAME];
  284. GetPlayerName(i, sendername, sizeof(sendername));
  285. if(vipinfo[i][viplevel] >= 0)
  286. {
  287. new vlevel[64];
  288. if(vipinfo[playerid][viplevel] == 0) { vlevel = "Rank"; }
  289. if(vipinfo[playerid][viplevel] == 1) { vlevel = "{FFFFFF}Vip Junior{00C0FF}[1]{FFFFFF}"; }
  290. else if(vipinfo[playerid][viplevel] == 2) { vlevel = "{FFFFFF}Vip Gold{00C0FF}[2]{FFFFFF}"; }
  291. else if(vipinfo[playerid][viplevel] == 3) { vlevel = "{FFFFFF}Vip premium{00C0FF}[3]{FFFFFF}"; }
  292. else if(vipinfo[playerid][viplevel] == 4) { vlevel = "{6EF83C}Vip Admin{00C0FF}[4]{FFFFFF}"; }
  293. format(string, sizeof(string), "{6EF83C}%s - %s", vlevel, sendername);
  294. ShowPlayerDialog(playerid, 1111, DIALOG_STYLE_MSGBOX, "{00C0FF}Vips", string, "-->oK<--", "");
  295. }
  296. }
  297. }
  298. }
  299. return 1;
  300. }
  301. CMD:vipdisarm(playerid, params[])
  302. {
  303. new
  304. id;
  305.  
  306. if (sscanf(params, "u", id)) SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipdisarm {F81414}[playerid]");
  307. else if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}Pleyrul nu este conectat");
  308. if(playerid == id) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}ERROR: Nu poti sa te dezarmezi pe tine!");
  309. if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}3 {FFFFFF}pentru aceasta comanda!"); return 1;}
  310. else
  311. {
  312. ResetPlayerWeapons(id);
  313. SendClientMessage(id,0x38FF06FF, "{FFFFFF}Vip tea dezarmat!");
  314. }
  315. return 1;
  316. }
  317. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  318. {
  319. new file[256];
  320. new string[128];
  321. if (dialogid == 1)
  322. {
  323. new name[MAX_PLAYER_NAME];
  324. GetPlayerName(playerid, name, sizeof(name));
  325. format(file, sizeof(file), "vipacount/user/%s.ini", name);
  326. if(!response) return Kick(playerid);
  327. if (!strlen(inputtext)) return
  328. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}register!", "{FFF1AF}Introdu parola pentru contu tau de {6EF83C}vip\n{FFF1AF}O sa fie nevoie sa te loghiezi dupa ce iesi de pe server", "Register", "Leave");
  329. dini_Create(file);
  330. dini_IntSet(file, "Password", udb_hash(inputtext));
  331. dini_IntSet(file, "vipLevel",vipinfo[playerid][viplevel] = 0);
  332. dini_IntSet(file, "VipLevelAdmin",vipinfo[playerid][vipadmin] = 0);
  333. format(string, 128, "{FFFFFF}Nume: {00C0FF}%s\n{FFFFFF}Parola: {00C0FF}%s", name, inputtext);
  334. ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_MSGBOX, "{6EF83C}Vip Information", string, "-->oK<--","");
  335. plogin[playerid] = 1;
  336. }
  337. if (dialogid == 2)
  338. {
  339. new name[MAX_PLAYER_NAME];
  340. GetPlayerName(playerid, name, sizeof(name));
  341. format(file, sizeof(file), "vipacount/user/%s.ini", name);
  342. if(!response) return Kick(playerid);
  343. if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}Login", "{FFF1AF}Introdu parola pentru a te putea loga", "Login", "Leave");
  344. new tmp;
  345. tmp = dini_Int(file, "Password");
  346. if(udb_hash(inputtext) != tmp) {
  347. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Wrong Password", "{F81414}Parola Gresita!", "Login", "Leave");
  348. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}Login", "{FFF1AF}Introdu parola pentru a te putea loga", "Login", "Leave");
  349. }
  350. else
  351. {
  352. plogin[playerid] = 1;
  353. vipinfo[playerid][viplevel] = dini_Int(file, "viplevel");
  354. SendClientMessage(playerid,0xFF444499, "{F81414}[VIP]: {FFFFFF}Acountul tau a fost activat foloseste {F81414}/vipcmds {FFFFFF}pe moment ai rank");
  355. }
  356. }
  357. return 1;
  358. }
Advertisement
Add Comment
Please, Sign In to add comment