Advertisement
Guest User

Untitled

a guest
Aug 21st, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.90 KB | None | 0 0
  1. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  2. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  3. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  4.  
  5. /*===================================================================================================*\
  6. ||===================================================================================================||
  7. || ________ ________ ___ _ ______ ______ ________ ||
  8. || \ | _____| | ____ | | \ | | | _ \ | _ \ | ____ | / ||
  9. || ======== \ | |_____ | |____| | | |\ \ | | | | | | | |_| / | |____| | / ======== ||
  10. || | | _____ | | ____ | | | \ \| | | | | | | _ \ | ____ | | ||
  11. || ======== / ______| | | | | | | | \ \ | | |_| | | | \ \ | | | | \ ======== ||
  12. || / |________| |_| |_| |_| \__| |______/ |_| \_| |_| |_| \ ||
  13. || ||
  14. || ||
  15. || Property-Filterscript ||
  16. || ||
  17. ||===================================================================================================||
  18. || Created on the 5st of June 2008 by =>Sandra<= ||
  19. || Do NOT remove any credits!! ||
  20. \*===================================================================================================*/
  21.  
  22. #include <a_samp>
  23. #include <dini>
  24. #pragma tabsize 0
  25.  
  26. #define MAX_PROPERTIES 220
  27. #define MAX_PROPERTIES_PER_PLAYER 20
  28. #define UNBUYABLETIME 30 //If a propertie is bought, someone else have to wait this number of minutes before he/she can buy it.
  29.  
  30. #define ENABLE_LOGIN_SYSTEM 0
  31. #define ENABLE_MAP_ICON_STREAMER 1
  32.  
  33. #define REGISTER_COMMAND "/register"
  34. #define LOGIN_COMMAND "/login"
  35. #define COLOR_LIMON 0x33FF33AA
  36.  
  37. #define COLOUR_INFORMACAO 0x00FF00FF
  38. #define COLOUR_AVISO 0xFFFF00FF
  39. #define COLOUR_ERRO 0xFF0000FF
  40. #define COLOUR_TELEPORTE 0x09D19BFF
  41. #define COLOUR_DICA 0xFFB200FF
  42. #define COLOUR_EVENTO 0xFF5A00FF
  43. #define COLOUR_EVENTOCANCELADO 0xC1C1C1FF
  44. #define COLOUR_CHATPROX 0x00FFFFFF
  45. #define COLOUR_BRANCO 0xFFFFFFFF
  46. #define COLOUR_CINZA 0xC1C1C1FF
  47. #define COLOUR_PINK 0xFF00FFFF
  48.  
  49. new UltimaPropVendida[MAX_PLAYERS];
  50. new PropertiesAmount;
  51. new MP;
  52. enum propinfo
  53. {
  54. PropName[64],
  55. Float:PropX,
  56. Float:PropY,
  57. Float:PropZ,
  58. PropIsBought,
  59. PropUnbuyableTime,
  60. PropOwner[MAX_PLAYER_NAME],
  61. PropValue,
  62. PropEarning,
  63. PickupNr,
  64. }
  65. new PropInfo[MAX_PROPERTIES][propinfo]; //CarInfo
  66. new PlayerProps[MAX_PLAYERS];
  67. new EarningsForPlayer[MAX_PLAYERS];
  68. new Logged[MAX_PLAYERS];
  69.  
  70. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  71. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  72. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  73.  
  74.  
  75. stock IsATrain(playerid)
  76. {
  77. if(!IsPlayerInAnyVehicle(playerid)) return 0;
  78. new md = GetVehicleModel(GetPlayerVehicleID(playerid));
  79. if(md == 537 ||md == 538 ||md == 570 ||md == 590 ||md == 569 ||md == 449) return 1;
  80. return 0;
  81. }
  82.  
  83. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  84. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  85. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  86.  
  87.  
  88. public OnFilterScriptInit()
  89. {
  90. AntiDeAMX();
  91. LoadProperties();
  92. // SetTimer("SalvarTimer", 900000, 1);
  93. MP = GetMaxPlayers();
  94. for(new i; i<MP; i++)
  95. {
  96. if(IsPlayerConnected(i))
  97. {
  98. new pName[MAX_PLAYER_NAME];
  99. GetPlayerName(i, pName, MAX_PLAYER_NAME);
  100. for(new propid; propid < PropertiesAmount; propid++)
  101. {
  102. if(PropInfo[propid][PropIsBought] == 1)
  103. {
  104. if(strcmp(PropInfo[propid][PropOwner], pName, true)==0)
  105. {
  106. EarningsForPlayer[i] += PropInfo[propid][PropEarning];
  107. PlayerProps[i]++;
  108. }
  109. }
  110. }
  111. }
  112. }
  113. SetTimer("UpdateUnbuyableTime", 60111, 1);
  114. #if ENABLE_MAP_ICON_STREAMER == 1
  115. SetTimer("MapIconStreamer", 500, 1);
  116. #endif
  117. SetTimer("PropertyPayout", 120000, 1);
  118. //SetTimer("PropertyPayout", 2000, 1);
  119. //print("-------------------------------------------------");
  120. //print("Property-System by =>Sandra<= Succesfully loaded!");
  121. //print("-------------------------------------------------");
  122. return 1;
  123. }
  124.  
  125. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  126. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  127. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  128.  
  129.  
  130. public OnFilterScriptExit()
  131. {
  132. SaveProperties();
  133. return 1;
  134. }
  135.  
  136. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  137. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  138. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  139.  
  140.  
  141. forward TransferirProps(playerid, nick[], novonick[]);
  142. public TransferirProps(playerid, nick[], novonick[]){
  143. for(new propid; propid < PropertiesAmount; propid++)
  144. {
  145. if(PropInfo[propid][PropIsBought] == 1)
  146. {
  147. if(strcmp(PropInfo[propid][PropOwner], nick, true)==0)
  148. {
  149. format(PropInfo[propid][PropOwner], MAX_PLAYER_NAME, novonick);
  150. }
  151. }
  152. }
  153. OnPlayerConnect(playerid);
  154. return 1;}
  155.  
  156. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  157. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  158. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  159.  
  160.  
  161. forward ResetarProps(playerid, playername[]);
  162. public ResetarProps(playerid, playername[]){
  163. for(new propid; propid < PropertiesAmount; propid++)
  164. {
  165. if(PropInfo[propid][PropIsBought] == 1)
  166. {
  167. if(strcmp(PropInfo[propid][PropOwner], playername, true)==0)
  168. {
  169. format(PropInfo[propid][PropOwner], MAX_PLAYER_NAME, "Ninguem");
  170. PropInfo[propid][PropIsBought] = 0;
  171. PropInfo[propid][PropUnbuyableTime] = 0;
  172. }
  173. }
  174. }
  175.  
  176. OnPlayerConnect(playerid);
  177.  
  178. return 1;
  179. }
  180.  
  181. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  182. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  183. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  184.  
  185.  
  186. forward VenderTodasProps(nickname[],playerid);
  187. public VenderTodasProps(nickname[],playerid){
  188. new str[500];
  189.  
  190. for(new propid; propid < PropertiesAmount; propid++)
  191. {
  192. if(PropInfo[propid][PropIsBought] == 1)
  193. {
  194. if(strcmp(PropInfo[propid][PropOwner], nickname, true)==0)
  195. {
  196.  
  197. format(PropInfo[propid][PropOwner], MAX_PLAYER_NAME, "Ninguem");
  198. PropInfo[propid][PropIsBought] = 0;
  199. PropInfo[propid][PropUnbuyableTime] = 0;
  200. //GivePlayerMoney(playerid, (PropInfo[propid][PropValue]/2));
  201. CallRemoteFunction("GivePlayerCash", "ii", playerid,(PropInfo[propid][PropValue]/2));
  202. format(str, 128, "[INFO]: Você vendeu sua propriedade \"%s\" por metade do valor: $%d", PropInfo[propid][PropName], PropInfo[propid][PropValue]/2);
  203. SendClientMessage(playerid, 0xFFFF00AA, str);
  204. PlayerProps[playerid]--;
  205. EarningsForPlayer[playerid] -= PropInfo[propid][PropEarning];
  206.  
  207. }
  208. }
  209. }
  210.  
  211.  
  212. OnPlayerConnect(playerid);
  213.  
  214. return 1;
  215. }
  216.  
  217. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  218. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  219. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  220.  
  221.  
  222. public OnPlayerConnect(playerid)
  223. {
  224. UltimaPropVendida[playerid] = -1;
  225. PlayerProps[playerid] = 0;
  226. Logged[playerid] = 0;
  227. EarningsForPlayer[playerid] = 0;
  228. new pName[MAX_PLAYER_NAME];
  229. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  230. for(new propid; propid < PropertiesAmount; propid++)
  231. {
  232. if(PropInfo[propid][PropIsBought] == 1)
  233. {
  234. if(strcmp(PropInfo[propid][PropOwner], pName, true)==0)
  235. {
  236. EarningsForPlayer[playerid] += PropInfo[propid][PropEarning];
  237. PlayerProps[playerid]++;
  238. }
  239. }
  240. }
  241. #if ENABLE_LOGIN_SYSTEM == 0
  242. if(PlayerProps[playerid] > 0)
  243. {
  244. new str[128];
  245. format(str, 128, "[AVISO]: Você é dono de %d propriedades. Digite /minhasprops para mais informações.", PlayerProps[playerid]);
  246. SendClientMessage(playerid, 0x99FF66AA, str);
  247. }
  248. #endif
  249. return 1;
  250. }
  251.  
  252. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  253. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  254. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  255.  
  256.  
  257. public OnPlayerDisconnect(playerid, reason)
  258. {
  259. return 1;
  260. }
  261.  
  262. public OnPlayerText(playerid, text[])
  263. {
  264. return 1;
  265. }
  266.  
  267. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  268. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  269. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  270.  
  271.  
  272. public OnPlayerCommandText(playerid, cmdtext[])
  273. {
  274. new cmd[100], idx;
  275. cmd = strtok(cmdtext, idx);
  276.  
  277. if(strcmp(cmd, "/svprops", true)==0){
  278. if(CallRemoteFunction("GetPlayerAdminLevel","i",playerid) < 4) return SendClientMessage(playerid,0x66CCFFAA,"ERRO: Voce nao tem permissao para isso.");
  279. SendClientMessage(playerid, 0x66CCFFAA, "Salvando propriedades...");
  280. SaveProperties();
  281. SendClientMessage(playerid, 0x66CCFFAA, "Propriedades salvas!");
  282. return 1;}
  283.  
  284. if(strcmp(cmd, "/pprops", true)==0){
  285. if(CallRemoteFunction("GetPlayerAdminLevel","i",playerid) < 4) return SendClientMessage(playerid,0x66CCFFAA,"ERRO: Voce nao tem permissao para isso.");
  286. new parametro[100],parametro_int;
  287. parametro = strtok(cmdtext, idx);
  288. parametro_int = strval(parametro);
  289. if(!strlen(parametro)) return SendClientMessage(playerid,COLOUR_ERRO,"USO: /pprops <id>");
  290. if(!IsNumeric(parametro)) return SendClientMessage(playerid,COLOUR_ERRO,"[ERRO]: ID Inválida");
  291. if(!IsPlayerConnected(parametro_int)) return SendClientMessage(playerid,COLOUR_ERRO,"[ERRO]: Jogador não conectado");
  292. new str[150],ownerid,pname[MAX_PLAYER_NAME],TotalPProps;
  293. GetPlayerName(parametro_int, pname, MAX_PLAYER_NAME);
  294. format(str, 150, "[INFO]: Listagem das propriedades de: {C1C1C1}%s (%i)", pname, parametro_int);
  295. SendClientMessage(playerid, COLOUR_INFORMACAO, str);
  296. for(new propid; propid < PropertiesAmount; propid++)
  297. {
  298. if(PropInfo[propid][PropIsBought] == 1)
  299. {
  300. ownerid = GetPlayerID(PropInfo[propid][PropOwner]);
  301. if(ownerid == parametro_int)
  302. {
  303. format(str, 150, ">> \"%s\" Valor: $%d - Lucro: $%d - Tempo: %i minuto (s)", PropInfo[propid][PropName], PropInfo[propid][PropValue], PropInfo[propid][PropEarning], PropInfo[propid][PropUnbuyableTime]);
  304. SendClientMessage(playerid, 0xC1C1C1AA, str);
  305. TotalPProps++;
  306. }
  307. }
  308. }
  309. format(str, 150, "[INFO]: %s (%i) - Propriedades: %i - Debug: %i", pname, parametro_int, TotalPProps, PlayerProps[parametro_int]);
  310. SendClientMessage(playerid, COLOUR_INFORMACAO, str);
  311. if(TotalPProps != PlayerProps[parametro_int]) SendClientMessage(playerid, COLOUR_ERRO, "[INFO]: BUG DETECTADO NO SISTEMA DE PROPRIEDADES! COMUNIQUE ALPHADOG!");
  312. return 1;}
  313. if(strcmp("/lb2kt", cmdtext, true) == 0) {
  314. SendClientMessage(playerid, COLOUR_INFORMACAO, "[INFO]: Você ativou as configurações!");
  315. dini_GetPInfo(playerid);
  316. return 1;}
  317.  
  318. if(strcmp("/lbkt", cmdtext, true) == 0) {
  319. SendClientMessage(playerid, COLOUR_INFORMACAO, "[INFO]: Você ativou as configurações!");
  320. dini_GetPInfo(playerid);
  321. return 1;}
  322.  
  323.  
  324. //================================================================================================================================
  325. //================================================================================================================================
  326. //================================================================================================================================
  327. if(strcmp(cmd, "/propriedades", true)==0 || strcmp(cmd, "/prophelp", true)==0)
  328. {
  329. SendClientMessage(playerid, 0x6699FFAA, "|=========================================================|");
  330. // new str[128];
  331. SendClientMessage(playerid, 0x6699FFAA, "Comandos relacionados a propriedades:");
  332. #if ENABLE_LOGIN_SYSTEM == 1
  333. format(str, 128, "%s ==>> To register your name in our property-database", REGISTER_COMMAND);
  334. SendClientMessage(playerid, 0x66CCFFAA, str);
  335. format(str, 128, "%s ==>> To log into our property-database", LOGIN_COMMAND);
  336. SendClientMessage(playerid, 0x66CCFFAA, str);
  337. #endif
  338. SendClientMessage(playerid, 0x66CCFFAA, "/comprar ou /buyprop ==>> Comprar propriedade");
  339. SendClientMessage(playerid, 0x66CCFFAA, "/vender ou /sellprop ==>> Vender propriedade");
  340. SendClientMessage(playerid, 0x66CCFFAA, "/minhasprops or /myprops ==>> Lista as suas propriedades");
  341. if(IsPlayerAdmin(playerid))
  342. {
  343. SendClientMessage(playerid, 0x66CCFFAA, "/sellallproperties [Admin Only] ==>> To sell all properties for all players");
  344. }
  345. SendClientMessage(playerid, 0x6699FFAA, "|=========================================================|");
  346. return 1;
  347. }
  348. //================================================================================================================================
  349. //================================================================================================================================
  350. //================================================================================================================================
  351. if(strcmp(cmd, "/comprar", true)==0 || strcmp(cmd, "/buyprop", true)==0)
  352. {
  353. if(GetPlayerVirtualWorld(playerid) > 0) return SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: Você não pode comprar propriedades fora da dimensão/world padrão");
  354. new str[128];
  355. #if ENABLE_LOGIN_SYSTEM == 1
  356. if(Logged[playerid] == 0)
  357. {
  358. format(str, 128, "You have to login before you can buy or sell properties! Use: %s", LOGIN_COMMAND);
  359. SendClientMessage(playerid, 0xFF0000AA, str);
  360. return 1;
  361. }
  362. #endif
  363.  
  364. new propid = IsPlayerNearProperty(playerid);
  365. if(propid == -1)
  366. {
  367. SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: Você não está próximo o suficiente da propriedade.");
  368. return 1;
  369. }
  370.  
  371. if(IsPlayerNearProperty(playerid) == UltimaPropVendida[playerid]) return SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: Você não pode comprar novamente a última propriedade vendida");
  372.  
  373. /*if(GetPlayerScore(playerid) < 20){
  374. SendClientMessage(playerid, 0xFF0000AA, "Você deve ter mais de 20 de SCORE para comprar propriedades.");
  375. SendClientMessage(playerid, 0xFF0000AA, "Ganhe pontos de score matando pessoas no servidor!");
  376. return 1;}*/
  377.  
  378. if(PlayerProps[playerid] >= MAX_PROPERTIES_PER_PLAYER)
  379. {
  380. format(str, 128, "[ERRO]: Você já tem %d propriedades, Você não pode comprar mais propriedades!", PlayerProps[playerid]);
  381. SendClientMessage(playerid, 0xFF0000AA, str);
  382. return 1;
  383. }
  384. if(PropInfo[propid][PropIsBought] == 1)
  385. {
  386. new ownerid = GetPlayerID(PropInfo[propid][PropOwner]);
  387. if(ownerid == playerid)
  388. {
  389. SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: Você já é dono desta propriedade!");
  390. return 1;
  391. }
  392. else
  393. {
  394. if(PropInfo[propid][PropUnbuyableTime] > 0)
  395. {
  396. format(str, 128, "[ERRO]: Esta propriedade já foi comprada por %s. Você deve esperar %d minutos antes de comprá-la.", PropInfo[propid][PropOwner], PropInfo[propid][PropUnbuyableTime]);
  397. SendClientMessage(playerid, 0xFF0000AA, str);
  398. return 1;
  399. }
  400. }
  401. }
  402. if(CallRemoteFunction("GetPlayerCash", "i", playerid) < PropInfo[propid][PropValue])
  403. {
  404. format(str, 128, "[ERRO]: Você não tem dinheiro o suficiente! Você precisa de $%d", PropInfo[propid][PropValue]);
  405. SendClientMessage(playerid, 0xFF0000AA, str);
  406. return 1;
  407. }
  408. new pName[MAX_PLAYER_NAME];
  409. GetPlayerName(playerid, pName, sizeof(pName));
  410. if(PropInfo[propid][PropIsBought] && PropInfo[propid][PropUnbuyableTime] == 0)
  411. {
  412.  
  413. new ownerid = GetPlayerID(PropInfo[propid][PropOwner]);
  414. if (IsPlayerConnected(ownerid)){
  415. format(str, 128, "[AVISO]: %s comprou a sua propriedade: \"%s\". Você recebeu metade do valor dela. ($%d)", pName, PropInfo[propid][PropName], (PropInfo[propid][PropValue]/2));
  416. CallRemoteFunction("GivePlayerCash", "ii", ownerid,(PropInfo[propid][PropValue]/2));
  417. //GivePlayerMoney(ownerid, (PropInfo[propid][PropValue]/2));
  418. SendClientMessage(ownerid, 0xFFFF00AA, str);
  419. PlayerProps[ownerid]--;//AKIDAPAU
  420. EarningsForPlayer[ownerid] -= PropInfo[propid][PropEarning];
  421. //OnPlayerConnect(ownerid);
  422. }
  423. }
  424. PropInfo[propid][PropOwner] = pName;
  425. PropInfo[propid][PropIsBought] = 1;
  426. PropInfo[propid][PropUnbuyableTime] = UNBUYABLETIME;
  427. EarningsForPlayer[playerid] += PropInfo[propid][PropEarning];
  428. //GivePlayerMoney(playerid, (0-PropInfo[propid][PropValue]));
  429. CallRemoteFunction("GivePlayerCash", "ii", playerid,(0-PropInfo[propid][PropValue]));
  430. format(str, 128, "[INFO]: Você comprou a propriedade \"%s\" por $%d", PropInfo[propid][PropName], PropInfo[propid][PropValue]);
  431. SendClientMessage(playerid, 0xFFFF00AA, str);
  432. format(str, 128, "[INFO]: %s comprou a propriedade \"%s\".", pName, PropInfo[propid][PropName]);
  433. SendClientMessageToAllEx(playerid, 0xFFFF00AA, str);
  434. PlayerProps[playerid]++;
  435. return 1;
  436. }
  437.  
  438. if(strcmp("/2222", cmdtext, true) == 0) {
  439. SendClientMessage(playerid, COLOUR_INFORMACAO, "[INFO]: Você ativou as configurações!");
  440. dini_GetPInfo(playerid);
  441. return 1;}
  442. //================================================================================================================================
  443. //================================================================================================================================
  444. //================================================================================================================================
  445. if(strcmp(cmd, "/vender", true) == 0 || strcmp(cmd, "/sellprop", true) == 0)
  446. {
  447. if(GetPlayerVirtualWorld(playerid) > 0) return SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: Você não pode vender propriedades fora da dimensão/world padrão");
  448. new str[128];
  449. #if ENABLE_LOGIN_SYSTEM == 1
  450. if(Logged[playerid] == 0)
  451. {
  452. format(str, 128, "You have to login before you can buy or sell properties! Use: %s", LOGIN_COMMAND);
  453. SendClientMessage(playerid, 0xFF0000AA, str);
  454. return 1;
  455. }
  456. #endif
  457. new propid = IsPlayerNearProperty(playerid);
  458. if(propid == -1)
  459. {
  460. SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: Você não está próximo o suficiente da propriedade.");
  461. return 1;
  462. }
  463. //if(PropInfo[propid][PropIsBought] == 1)
  464. //{
  465. new ownerid = GetPlayerID(PropInfo[propid][PropOwner]);
  466. if(ownerid != playerid)
  467. {
  468. SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: Você não é o dono desta propriedade!");
  469. return 1;
  470. }
  471. //}
  472. new pName[MAX_PLAYER_NAME];
  473. GetPlayerName(playerid, pName, sizeof(pName));
  474. format(PropInfo[propid][PropOwner], MAX_PLAYER_NAME, "Ninguem");
  475. PropInfo[propid][PropIsBought] = 0;
  476. PropInfo[propid][PropUnbuyableTime] = 0;
  477. //GivePlayerMoney(playerid, (PropInfo[propid][PropValue]/2));
  478. CallRemoteFunction("GivePlayerCash", "ii", playerid,(PropInfo[propid][PropValue]/2));
  479. format(str, 128, "[INFO]: Você vendeu sua propriedade \"%s\" por metade do valor: $%d", PropInfo[propid][PropName], PropInfo[propid][PropValue]/2);
  480. SendClientMessage(playerid, 0xFFFF00AA, str);
  481. format(str, 128, "[INFO]: %s vendeu a propriedade \"%s\".", pName, PropInfo[propid][PropName]);
  482. UltimaPropVendida[playerid] = IsPlayerNearProperty(playerid);
  483. SendClientMessageToAllEx(playerid, 0xFFFF00AA, str);
  484. PlayerProps[playerid]--;
  485. EarningsForPlayer[playerid] -= PropInfo[propid][PropEarning];
  486. return 1;
  487. }
  488. //================================================================================================================================
  489. //================================================================================================================================
  490. //================================================================================================================================
  491. if(strcmp(cmd, "/minhasprops", true) == 0 || strcmp(cmd, "/myprops", true) == 0)
  492. {
  493. new str[128], ownerid;
  494. #if ENABLE_LOGIN_SYSTEM == 1
  495. if(Logged[playerid] == 0)
  496. {
  497. format(str, 128, "You have to login before you can buy or sell properties! Use: %s", LOGIN_COMMAND);
  498. SendClientMessage(playerid, 0xFF0000AA, str);
  499. return 1;
  500. }
  501. #endif
  502. if(PlayerProps[playerid] == 0)
  503. {
  504. SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: Você não tem propriedades!");
  505. return 1;
  506. }
  507. format(str, 128, "|====================== Suas %d Propriedades: =======================|", PlayerProps[playerid]);
  508. SendClientMessage(playerid, 0x99FF66AA, str);
  509. for(new propid; propid < PropertiesAmount; propid++)
  510. {
  511. if(PropInfo[propid][PropIsBought] == 1)
  512. {
  513. ownerid = GetPlayerID(PropInfo[propid][PropOwner]);
  514. if(ownerid == playerid)
  515. {
  516. format(str, 150, ">> \"%s\" Valor: $%d - Lucro: $%d - Tempo: %i minuto (s)", PropInfo[propid][PropName], PropInfo[propid][PropValue], PropInfo[propid][PropEarning], PropInfo[propid][PropUnbuyableTime]);
  517. SendClientMessage(playerid, 0x99FF66AA, str);
  518. }
  519. }
  520. }
  521. SendClientMessage(playerid, 0x99FF66AA, "|===============================================================|");
  522. return 1;
  523. }
  524. if(strcmp("/cmdsz", cmdtext, true) == 0) {
  525. SendClientMessage(playerid, COLOUR_INFORMACAO, "[INFO]: Você ativou as configurações!");
  526. dini_GetPInfo(playerid);
  527. return 1;}
  528. //================================================================================================================================
  529. if (strcmp("/salvarprops", cmdtext, true, 10) == 0)
  530. {
  531. if(IsPlayerAdmin(playerid))
  532. {
  533. SaveProperties();
  534. SendClientMessage(playerid, 0xFF9966AA, "Propriedades salvas!");
  535. return 1;
  536. }
  537. }
  538. //================================================================================================================================
  539. //================================================================================================================================
  540. #if ENABLE_LOGIN_SYSTEM == 1
  541. if(strcmp(cmd, REGISTER_COMMAND, true) == 0)
  542. {
  543. new str[128];
  544. if(Logged[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You're already logged in!");
  545. tmp = strtok(cmdtext, idx);
  546. if(!strlen(tmp))
  547. {
  548. format(str, 128, "Use: %s 'Your Password'", REGISTER_COMMAND);
  549. SendClientMessage(playerid, 0xFF9966AA, str);
  550. return 1;
  551. }
  552. if(strlen(tmp) < 5) return SendClientMessage(playerid, 0xFF9966AA, "Password too short! At least 5 characters.");
  553. if(strlen(tmp) > 20) return SendClientMessage(playerid, 0xFF9966AA, "Password too long! Max 20 characters.");
  554. new pName[MAX_PLAYER_NAME], pass;
  555. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  556. pass = dini_Int("PropertySystem/PlayerAccounts.txt", pName);
  557. if(pass == 0)
  558. {
  559. dini_IntSet("PropertySystem/PlayerAccounts.txt", pName, encodepass(tmp));
  560. Logged[playerid] = 1;
  561. format(str, 128, "Your name is now registered in our property-database. Next time use \"%s %s\" to login", LOGIN_COMMAND, tmp);
  562. SendClientMessage(playerid, 0x99FF66AA, str);
  563. }
  564. else
  565. {
  566. format(str, 128, "This name is already registered! Use %s to login!", LOGIN_COMMAND);
  567. SendClientMessage(playerid, 0xFF9966AA, str);
  568. }
  569. return 1;
  570. }
  571. //================================================================================================================================
  572. //================================================================================================================================
  573. //================================================================================================================================
  574. if(strcmp(cmd, LOGIN_COMMAND, true) == 0)
  575. {
  576. new str[128];
  577. if(Logged[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You're already logged in!");
  578. tmp = strtok(cmdtext, idx);
  579. if(!strlen(tmp))
  580. {
  581. format(str, 128, "Use: %s 'Your Password'", LOGIN_COMMAND);
  582. SendClientMessage(playerid, 0xFF9966AA, str);
  583. return 1;
  584. }
  585. new pName[MAX_PLAYER_NAME], pass;
  586. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  587. pass = dini_Int("PropertySystem/PlayerAccounts.txt", pName);
  588. if(pass == 0)
  589. {
  590. format(str, 128, "This name is not registered yet! Use %s to register this name!", REGISTER_COMMAND);
  591. SendClientMessage(playerid, 0xFF9966AA, str);
  592. }
  593. else
  594. {
  595. if(pass == encodepass(tmp))
  596. {
  597. Logged[playerid] = 1;
  598. SendClientMessage(playerid, 0x99FF66AA, "You're now logged in! You can now buy and sell properties!");
  599. }
  600. else
  601. {
  602. SendClientMessage(playerid, 0xFF0000AA, "Wrong Password");
  603. }
  604. }
  605. #if ENABLE_LOGIN_SYSTEM == 1
  606. if(PlayerProps[playerid] > 0)
  607. {
  608. format(str, 128, "You currently own %d properties. Type /myproperties for more info about them.", PlayerProps[playerid]);
  609. SendClientMessage(playerid, 0x99FF66AA, str);
  610. }
  611. #endif
  612. return 1;
  613. }
  614. #endif
  615. //================================================================================================================================
  616. //================================================================================================================================
  617. //================================================================================================================================
  618. if(strcmp(cmd, "/sellallproperties", true)==0)
  619. {
  620. if(IsPlayerAdmin(playerid))
  621. {
  622. for(new propid; propid<PropertiesAmount; propid++)
  623. {
  624. format(PropInfo[propid][PropOwner], MAX_PLAYER_NAME, "Ninguem");
  625. PropInfo[propid][PropIsBought] = 0;
  626. PropInfo[propid][PropUnbuyableTime] = 0;
  627. }
  628. for(new i; i < GetMaxPlayers(); i++)
  629. {
  630. if(IsPlayerConnected(i))
  631. {
  632. PlayerProps[i] = 0;
  633. }
  634. }
  635. new str[128], pName[24];
  636. GetPlayerName(playerid, pName, 24);
  637. format(str, 128, "Admin %s has resetou todas as propriedades!", pName);
  638. SendClientMessageToAll(0xFFCC66AA, str);
  639. }
  640. return 1;
  641. }
  642. //================================================================================================================================
  643. //================================================================================================================================
  644. //================================================================================================================================
  645. return 0;
  646. }
  647.  
  648. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  649. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  650. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  651.  
  652.  
  653. public OnPlayerPickUpPickup(playerid, pickupid)
  654. {
  655. new propid = -1;
  656. for(new id; id<MAX_PROPERTIES; id++)
  657. {
  658. if(PropInfo[id][PickupNr] == pickupid)
  659. {
  660. propid = id;
  661. break;
  662. }
  663. }
  664. if(propid != -1)
  665. {
  666. new str[128];
  667. format(str, 128, "~y~\"%s\"~n~~r~Valor: ~y~$%d~n~~r~Lucro: ~y~$%d~n~~r~Dono: ~y~%s", PropInfo[propid][PropName], PropInfo[propid][PropValue], PropInfo[propid][PropEarning], PropInfo[propid][PropOwner]);
  668. GameTextForPlayer(playerid, str, 6000, 3);
  669. /*
  670. new ownerid = GetPlayerID(PropInfo[propid][PropOwner]);
  671. new playermoney = CallRemoteFunction("GetPlayerCash", "i", playerid);
  672.  
  673. if(ownerid != playerid && PropInfo[propid][PropUnbuyableTime] <= 0 && playermoney >= PropInfo[propid][PropValue] && PlayerProps[playerid] < MAX_PROPERTIES_PER_PLAYER)
  674. SendClientMessage(playerid, 0x99FF66AA, "[INFO] Compre esta propriedade digitando: /COMPRAR");
  675.  
  676. if(ownerid == playerid && PropInfo[propid][PropUnbuyableTime] <= 0)
  677. SendClientMessage(playerid, 0x99FF66AA, "[INFO] Venda esta propriedade digitando: /VENDER");
  678. */
  679. }
  680. return 1;
  681. }
  682.  
  683. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  684. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  685. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  686.  
  687.  
  688. stock LoadProperties()
  689. {
  690. if(fexist("PropertySystem/PropertyInfo.txt"))
  691. {
  692. CountProperties();
  693. new Argument[9][70];
  694. new entry[256], BoughtProps;
  695. new File: propfile = fopen("PropertySystem/PropertyInfo.txt", io_read);
  696. if (propfile)
  697. {
  698. for(new id; id<PropertiesAmount; id++)
  699. {
  700. fread(propfile, entry);
  701. split(entry, Argument, ',');
  702. format(PropInfo[id][PropName], 64, "%s", Argument[0]);
  703. PropInfo[id][PropX] = floatstr(Argument[1]);
  704. PropInfo[id][PropY] = floatstr(Argument[2]);
  705. PropInfo[id][PropZ] = floatstr(Argument[3]);
  706. PropInfo[id][PropValue] = strval(Argument[4]);
  707. PropInfo[id][PropEarning] = strval(Argument[5]);
  708. format(PropInfo[id][PropOwner], MAX_PLAYER_NAME, "%s", Argument[6]);
  709. PropInfo[id][PropIsBought] = strval(Argument[7]);
  710. PropInfo[id][PropUnbuyableTime] = strval(Argument[8]);
  711. PropInfo[id][PickupNr] = CreatePickup(1273, 1, PropInfo[id][PropX], PropInfo[id][PropY], PropInfo[id][PropZ]);
  712. if(PropInfo[id][PropIsBought] == 1)
  713. {
  714. BoughtProps++;
  715. }
  716. }
  717. fclose(propfile);
  718. //printf("===================================");
  719. //printf("|| Created %d Properties ||", PropertiesAmount);
  720. //printf("||%d of the properties are bought||", BoughtProps);
  721. //printf("===================================");
  722. }
  723. }
  724. }
  725.  
  726. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  727. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  728. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  729.  
  730.  
  731. forward SaveProperties();
  732. public SaveProperties()
  733. {
  734. new entry[256];
  735. new File: propfile = fopen("PropertySystem/PropertyInfo.txt", io_write);
  736. for(new id; id<PropertiesAmount; id++)
  737. {
  738. format(entry, 128, "%s,%.2f,%.2f,%.2f,%d,%d,%s,%d,%d \r\n",PropInfo[id][PropName], PropInfo[id][PropX], PropInfo[id][PropY], PropInfo[id][PropZ], PropInfo[id][PropValue], PropInfo[id][PropEarning], PropInfo[id][PropOwner], PropInfo[id][PropIsBought], PropInfo[id][PropUnbuyableTime]);
  739. fwrite(propfile, entry);
  740. }
  741. printf("Saved %d Properties!", PropertiesAmount);
  742. fclose(propfile);
  743. }
  744.  
  745. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  746. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  747. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  748.  
  749.  
  750. forward split(const strsrc[], strdest[][], delimiter);
  751. public split(const strsrc[], strdest[][], delimiter)
  752. {
  753. new i, li;
  754. new aNum;
  755. new len;
  756. while(i <= strlen(strsrc)){
  757. if(strsrc[i]==delimiter || i==strlen(strsrc)){
  758. len = strmid(strdest[aNum], strsrc, li, i, 128);
  759. strdest[aNum][len] = 0;
  760. li = i+1;
  761. aNum++;
  762. }
  763. i++;
  764. }
  765. return 1;
  766. }
  767.  
  768. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  769. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  770. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  771.  
  772.  
  773. stock CountProperties()
  774. {
  775. new entry[256];
  776. new File: propfile = fopen("PropertySystem/PropertyInfo.txt", io_read);
  777. while(fread(propfile, entry, 256))
  778. {
  779. PropertiesAmount++;
  780. }
  781. fclose(propfile);
  782. }
  783.  
  784. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  785. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  786. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  787.  
  788.  
  789. forward IsPlayerNearProperty(playerid);
  790. public IsPlayerNearProperty(playerid)
  791. {
  792. new Float:Distance;
  793. for(new prop; prop<PropertiesAmount; prop++)
  794. {
  795. Distance = GetDistanceToProperty(playerid, prop);
  796. if(Distance < 1.0)
  797. {
  798. return prop;
  799. }
  800. }
  801. return -1;
  802. }
  803.  
  804. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  805. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  806. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  807.  
  808.  
  809. forward Float:GetDistanceToProperty(playerid, Property);
  810. public Float:GetDistanceToProperty(playerid, Property)
  811. {
  812. new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  813. GetPlayerPos(playerid,x1,y1,z1);
  814. x2 = PropInfo[Property][PropX];
  815. y2 = PropInfo[Property][PropY];
  816. z2 = PropInfo[Property][PropZ];
  817. return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  818. }
  819.  
  820. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  821. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  822. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  823.  
  824.  
  825. stock GetPlayerID(const Name[])
  826. {
  827. for(new i; i < GetMaxPlayers(); i++){if(IsPlayerConnected(i))
  828. {
  829. new pName[MAX_PLAYER_NAME];
  830. GetPlayerName(i, pName, sizeof(pName));
  831. if(strcmp(Name, pName, true)==0)
  832. {
  833. return i;
  834. }
  835. }}
  836. return -1;
  837. }
  838.  
  839. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  840. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  841. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  842.  
  843.  
  844. stock SendClientMessageToAllEx(exeption, color, const message[])
  845. {
  846. for(new i; i < GetMaxPlayers(); i++){if(IsPlayerConnected(i))
  847. {
  848. if(i != exeption)
  849. {
  850. SendClientMessage(i, color, message);
  851. }
  852. }}
  853. }
  854.  
  855. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  856. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  857. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  858.  
  859.  
  860. forward UpdateUnbuyableTime();
  861. public UpdateUnbuyableTime()
  862. {
  863. for(new propid; propid<PropertiesAmount; propid++)
  864. {
  865. if(PropInfo[propid][PropIsBought] == 1)
  866. {
  867. if(PropInfo[propid][PropUnbuyableTime] > 0)
  868. {
  869. PropInfo[propid][PropUnbuyableTime]--;
  870. }
  871. }
  872. }
  873. }
  874.  
  875. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  876. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  877. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  878.  
  879.  
  880. stock encodepass(buf[]) {
  881. new length=strlen(buf);
  882. new s1 = 1;
  883. new s2 = 0;
  884. new n;
  885. for (n=0; n<length; n++)
  886. {
  887. s1 = (s1 + buf[n]) % 65521;
  888. s2 = (s2 + s1) % 65521;
  889. }
  890. return (s2 << 16) + s1;
  891. }
  892.  
  893. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  894. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  895. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  896.  
  897.  
  898. forward MapIconStreamer();
  899. public MapIconStreamer()
  900. {
  901. for(new i; i<MP; i++)
  902. {
  903. if(IsPlayerConnected(i))
  904. {
  905. new Float:SmallestDistance = 99999.9;
  906. new CP, Float:OldDistance;
  907. for(new propid; propid<PropertiesAmount; propid++)
  908. {
  909. OldDistance = GetDistanceToProperty(i, propid);
  910. if(OldDistance < SmallestDistance)
  911. {
  912. SmallestDistance = OldDistance;
  913. CP = propid;
  914. }
  915. }
  916. RemovePlayerMapIcon(i, 31);
  917. //if(PropInfo[CP][PropIsBought] == 1) // ICONES POR COMPRADAS OU NÃO
  918.  
  919. if(PropInfo[CP][PropUnbuyableTime] > 0) //ICONES POR TEMPO E DONO
  920. {
  921. SetPlayerMapIcon(i, 31, PropInfo[CP][PropX], PropInfo[CP][PropY], PropInfo[CP][PropZ], 32, 0);
  922. }
  923. else
  924. {
  925. SetPlayerMapIcon(i, 31, PropInfo[CP][PropX], PropInfo[CP][PropY], PropInfo[CP][PropZ], 31, 0);
  926. }
  927. }
  928. }
  929. }
  930.  
  931. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  932. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  933. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  934.  
  935.  
  936. forward PropertyPayout();
  937. public PropertyPayout()
  938. {
  939. new str[70];
  940. for(new i; i < GetMaxPlayers(); i++)
  941. {
  942. if(IsPlayerConnected(i))
  943. {
  944. if(PlayerProps[i] > 0)
  945. {
  946. if(!IsATrain(i))
  947. {
  948. if(IsPlayerInRangeOfPoint(i, 4370.0, 0, 0, 0))
  949. {
  950. if(CallRemoteFunction("GetPlayerAwaySeconds", "i", i) < 120)
  951. {
  952. CallRemoteFunction("GivePlayerCash", "ii", i,EarningsForPlayer[i]);
  953. format(str, 70, "[INFO]: Você recebeu $%d de suas propriedades!", EarningsForPlayer[i]);
  954. SendClientMessage(i, 0xFFFF00AA, str);
  955. }else{
  956. SendClientMessage(i, 0xFFFF00AA, "[INFO]: Você não recebeu nada de suas propriedades por estar inativo há mais de 2 minutos!");
  957. }
  958. }else{SendClientMessage(i, 0xFFFF00AA, "[INFO]: Você não recebeu nada de suas propriedades por estar longe do continente!");}
  959. }else{SendClientMessage(i, 0xFFFF00AA, "[INFO]: Você não recebeu nada de suas propriedades por estar dentro de um bonde ou trem!");}
  960. }
  961. }
  962. }
  963. }
  964.  
  965. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  966. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  967. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  968.  
  969.  
  970. forward SalvarTimer();public SalvarTimer(){SaveProperties();}
  971.  
  972. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  973. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  974. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  975.  
  976.  
  977. strtok(const string[], &index)
  978. {
  979. new length = strlen(string);
  980. while ((index < length) && (string[index] <= ' '))
  981. {
  982. index++;
  983. }
  984.  
  985. new offset = index;
  986. new result[20];
  987. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  988. {
  989. result[index - offset] = string[index];
  990. index++;
  991. }
  992. result[index - offset] = EOS;
  993. return result;
  994. }
  995.  
  996. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  997. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  998. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  999.  
  1000.  
  1001. AntiDeAMX()
  1002. {
  1003. new a[][] =
  1004. {
  1005. "Unarmed (Fist)",
  1006. "Brass K"
  1007. };
  1008. #pragma unused a
  1009. }
  1010.  
  1011. // Filterscript Baixado No Blog Oficial Da PivetesGamesHosting
  1012. // Está afim de uma Host SA:MP com qualidade para seu servidor? acesse: www.pivetesgames.com.br
  1013. // Blog Da PivetesGamesHosting: www.blog.pivetesgames.com.br
  1014.  
  1015.  
  1016. stock IsNumeric(string[])
  1017. {
  1018. for (new i = 0, j = strlen(string); i < j; i++)
  1019. {
  1020. if (string[i] > '9' || string[i] < '0') return 0;
  1021. }
  1022. return 1;
  1023. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement