Advertisement
Guest User

Untitled

a guest
Dec 7th, 2010
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 17.14 KB | None | 0 0
  1. //By Rangel//
  2.  
  3. #include <a_samp>
  4. #include <Dini>
  5. #include <cpstream>
  6. #include <dudb>
  7. //PROGRMS USER
  8. #pragma unused ret_memcpy
  9. //defines
  10. #define SOUND_OFF                               1184
  11.  
  12. //FORWARDS//
  13. forward OnPlayerRegister(playerid, password[]);
  14. forward OnPlayerLogin(playerid,password[]);
  15. forward Encrypt(string[]);
  16. forward LoginAgora(playerid);
  17. //NEWS VARIAVEIS//
  18. new gPlayerLogged[MAX_PLAYERS];
  19. new logouagora[MAX_PLAYERS];
  20. new gPlayerLogTries[MAX_PLAYERS];
  21.  
  22. new TempoLogin;
  23.  
  24. new motd[256];
  25. //ENUMS//
  26. enum pInfo
  27. {
  28.     pKey[127],
  29.     pLevel,
  30.     pAdmin,
  31.     pSocio,
  32.     Float:pPos_x,
  33.     Float:pPos_y,
  34.     Float:pPos_z,
  35.     pReg,
  36.     pLocal,
  37.     pEmprego,
  38. };
  39. new PlayerInfo[MAX_PLAYERS][pInfo];
  40.  
  41. main()
  42. {
  43.     print("");
  44. }
  45. public OnFilterScriptInit()
  46. {
  47.     AddPlayerClass(26,-89.7290,1228.7631,19.7422,2.0481,0,0,0,0,0,0);
  48.     return 1;
  49. }
  50.  
  51. public OnFilterScriptExit()
  52. {
  53.     return 1;
  54. }
  55. public OnPlayerRequestClass(playerid, classid)
  56. {
  57.    new plname[MAX_PLAYER_NAME];
  58.    new string[MAX_PLAYER_NAME];
  59.    if(gPlayerLogged[playerid] == 0)
  60.    {
  61.    GetPlayerName(playerid, plname, sizeof(plname));
  62.    format(string, sizeof(string), "%s.ini", plname);
  63.    if(fexist(string))
  64.    {
  65.    SetPlayerPos(playerid,-2660.8506,1455.0502,67.4726);
  66.    SetPlayerFacingAngle(playerid, 276.3773);
  67.    SetPlayerCameraPos(playerid, -2701.9802,1455.7220,67.4726);
  68.    SetPlayerCameraLookAt(playerid, 1197.7450,-903.2322,48.0625);
  69.    ApplyAnimation(playerid,"DANCING","DAN_Loop_A",4.1,0,1,1,1,1);
  70.    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "FS login e Registro By Rangel\nDigite sua Senha para Logar!!!", "Logar", "Sair");
  71.    }
  72.    else
  73.    {
  74.    SetPlayerPos(playerid,-2660.8506,1455.0502,67.4726);
  75.    SetPlayerFacingAngle(playerid, 276.3773);
  76.    SetPlayerCameraPos(playerid, -2701.9802,1455.7220,67.4726);
  77.    SetPlayerCameraLookAt(playerid, 1197.7450,-903.2322,48.0625);
  78.    ApplyAnimation(playerid,"DANCING","DAN_Loop_A",4.1,0,1,1,1,1);
  79.    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Registrar", "FS login e Registro By Rangel\nDigite sua Senha para Registrar!!!", "Registrar", "Sair");
  80.    }
  81.    return 1;
  82.    }
  83.    return 1;
  84. }
  85.  
  86. public OnPlayerConnect(playerid)
  87. {
  88.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  89.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  90.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  91.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  92.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  93.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  94.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  95.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  96.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  97.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  98.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  99.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  100.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  101.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  102.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  103.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  104.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  105.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  106.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  107.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  108.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  109.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  110.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  111.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  112.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  113.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  114.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  115.     SendClientMessage(playerid, 0x8CFF00AA , "                    ");
  116.     SendClientMessage(playerid, 0x8CFF00AA, "•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×");
  117.     SendClientMessage(playerid, 0x8CFF00AA, "                     ");
  118.     SendClientMessage(playerid, 0xB8001BAA, "» FS de login By Rangel");
  119.     SendClientMessage(playerid, 0x8CFF00AA, "                     ");
  120.     SendClientMessage(playerid, 0x8CFF00AA, "•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×•×");
  121.  
  122.     new Float:X,Y,Z;
  123.     PlayerPlaySound(playerid, 1185, X, Y, Z);
  124.     gPlayerLogged[playerid] = 0;gPlayerLogTries[playerid] = 0;
  125.     return 1;
  126. }
  127.  
  128. public OnPlayerDisconnect(playerid, reason)
  129. {
  130.     return 1;
  131. }
  132.  
  133. public OnPlayerSpawn(playerid)
  134. {
  135.     new plname[MAX_PLAYER_NAME];
  136.     new string[MAX_PLAYER_NAME];
  137.     new Float:x;
  138.     new Float:y;
  139.     new Float:z;
  140.     PlayerPlaySound(playerid,SOUND_OFF,x, y, z);//Music Off
  141.     if(gPlayerLogged[playerid] == 0)
  142.         {
  143.         GetPlayerName(playerid, plname, sizeof(plname));
  144.         format(string, sizeof(string), "%s.ini", plname);
  145.         if(fexist(string))
  146.         {
  147.         SetPlayerInterior(playerid, 0);
  148.         SetPlayerPos(playerid, -2660.8506,1455.0502,67.4726);
  149.         SetPlayerFacingAngle(playerid, 160.0);
  150.         SetPlayerCameraPos(playerid, -2701.9802,1455.7220,67.4726);
  151.         SetPlayerCameraLookAt(playerid, 1537.1453,-1670.2620,12.6740);
  152.         ApplyAnimation(playerid,"DANCING","DAN_Loop_A",4.1,0,1,1,1,1);
  153.         ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "FS login e Registro By Rangel\nDigite sua Senha para Logar!!!", "Logar", "Sair");
  154.         }
  155.         else
  156.         {
  157.         SetPlayerInterior(playerid, 0);
  158.         SetPlayerPos(playerid, -2660.8506,1455.0502,67.4726);
  159.         SetPlayerFacingAngle(playerid, 160.0);
  160.         SetPlayerCameraPos(playerid, -2701.9802,1455.7220,67.4726);
  161.         SetPlayerCameraLookAt(playerid, 1537.1453,-1670.2620,12.6740);
  162.         ApplyAnimation(playerid,"DANCING","DAN_Loop_A",4.1,0,1,1,1,1);
  163.         ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Registrar", "FS login e Registro By Rangel\nDigite sua Senha para Registrar!!!", "Registrar", "Sair");
  164.         }
  165.         return 1;
  166.     }
  167.     return 1;
  168. }
  169. public OnVehicleSpawn(vehicleid)
  170. {
  171.     return 1;
  172. }
  173.  
  174. public OnVehicleDeath(vehicleid, killerid)
  175. {
  176.     return 1;
  177. }
  178.  
  179. public OnPlayerText(playerid, text[])
  180. {
  181.     return 1;
  182. }
  183.  
  184. public OnPlayerCommandText(playerid, cmdtext[])
  185. {
  186.     new cmd[256];
  187.     new string[256];
  188.     new tmp[256];
  189.     new sendername[MAX_PLAYER_NAME];
  190.     new idx;
  191.     cmd = strtok(cmdtext, idx);
  192.     if (strcmp(cmd, "/registrar", true) ==0 )
  193.     {
  194.     if(IsPlayerConnected(playerid))
  195.     {
  196.     if(gPlayerLogged[playerid] == 1)
  197.     {
  198.     SendClientMessage(playerid, 0x68FF6FAA, "Você já está logado.");
  199.     return 1;
  200.     }
  201.     GetPlayerName(playerid, sendername, sizeof(sendername));
  202.     format(string, sizeof(string), "%s.ini", sendername);
  203.     new File: hFile = fopen(string, io_read);
  204.     if (hFile)
  205.     {
  206.     SendClientMessage(playerid, 0xFFF540AA, "Este Nick já existe, tente outro.");
  207.     fclose(hFile);
  208.     return 1;
  209.     }
  210.     new tmppass[64];
  211.     tmp = strtok(cmdtext, idx);
  212.     if(!strlen(tmp))
  213.     {
  214.     SendClientMessage(playerid, 0x709AFFAA, "USE:/Registrar (Senha)");
  215.     return 1;
  216.     }
  217.     strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
  218.     OnPlayerRegister(playerid,tmppass);
  219.     }
  220.     return 1;
  221.     }
  222.     if (strcmp(cmd,"/MudarSenha",true) ==0 )
  223.     {
  224.     if(IsPlayerConnected(playerid))
  225.     {
  226.     if(gPlayerLogged[playerid] == 0)
  227.     {
  228.     SendClientMessage(playerid,0xC0C6B6AA,"Você não está Registrado !");
  229.     return 1;
  230.     }
  231.     GetPlayerName(playerid,sendername,sizeof(sendername));
  232.     format(string,sizeof(string),"%s.ini",sendername);
  233.     new tmppass[64];
  234.     tmp = strtok(cmdtext,idx);
  235.     if(!strlen(tmp))
  236.     {
  237.     SendClientMessage(playerid,0xC0C6B6AA1,"Use: /MudarSenha (Nova Senha)");
  238.     return 1;
  239.     }
  240.     strmid(tmppass,tmp,0,strlen(cmdtext),255);
  241.     Encrypt(tmppass);
  242.     OnPlayerRegister(playerid,tmppass);
  243.     return 1;
  244.     }
  245.     }
  246.     if (strcmp(cmd, "/logar", true) ==0 )
  247.     {
  248.     if(IsPlayerConnected(playerid))
  249.     {
  250.     new tmppass[64];
  251.     if(gPlayerLogged[playerid] == 1)
  252.     {
  253.     SendClientMessage(playerid, 0x68FF6FAA, "Você já esta logado.");
  254.     return 1;
  255.     }
  256.     tmp = strtok(cmdtext, idx);
  257.     if(!strlen(tmp))
  258.     {
  259.     SendClientMessage(playerid, 0x709AFFAA, "USE:/logar (Senha)");
  260.     return 1;
  261.     }
  262.     strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
  263.     OnPlayerLogin(playerid,tmppass);
  264.     }
  265.     return 1;
  266.     }
  267.     return 0;
  268. }
  269.  
  270. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  271. {
  272.     return 1;
  273. }
  274.  
  275. public OnPlayerExitVehicle(playerid, vehicleid)
  276. {
  277.     return 1;
  278. }
  279.  
  280. public OnPlayerStateChange(playerid, newstate, oldstate)
  281. {
  282.     return 1;
  283. }
  284.  
  285. public OnPlayerEnterCheckpoint(playerid)
  286. {
  287.     return 1;
  288. }
  289.  
  290. public OnPlayerLeaveCheckpoint(playerid)
  291. {
  292.     return 1;
  293. }
  294.  
  295. public OnPlayerEnterRaceCheckpoint(playerid)
  296. {
  297.     return 1;
  298. }
  299.  
  300. public OnPlayerLeaveRaceCheckpoint(playerid)
  301. {
  302.     return 1;
  303. }
  304.  
  305. public OnRconCommand(cmd[])
  306. {
  307.     return 1;
  308. }
  309.  
  310. public OnPlayerRequestSpawn(playerid)
  311. {
  312.     return 1;
  313. }
  314.  
  315. public OnObjectMoved(objectid)
  316. {
  317.     return 1;
  318. }
  319.  
  320. public OnPlayerObjectMoved(playerid, objectid)
  321. {
  322.     return 1;
  323. }
  324.  
  325. public OnPlayerPickUpPickup(playerid, pickupid)
  326. {
  327.     return 1;
  328. }
  329.  
  330. public OnVehicleMod(playerid, vehicleid, componentid)
  331. {
  332.     return 1;
  333. }
  334.  
  335. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  336. {
  337.     return 1;
  338. }
  339.  
  340. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  341. {
  342.     return 1;
  343. }
  344.  
  345. public OnPlayerSelectedMenuRow(playerid, row)
  346. {
  347.      return 1;
  348. }
  349.  
  350. public OnPlayerExitedMenu(playerid)
  351. {
  352.     TogglePlayerControllable(playerid, true);
  353.     return 1;
  354. }
  355.  
  356. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  357. {
  358.     return 1;
  359. }
  360.  
  361. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  362. {
  363.     return 1;
  364. }
  365.  
  366. public OnRconLoginAttempt(ip[], password[], success)
  367. {
  368.     return 1;
  369. }
  370.  
  371. public OnPlayerUpdate(playerid)
  372. {
  373.     return 1;
  374. }
  375.  
  376. public OnPlayerStreamIn(playerid, forplayerid)
  377. {
  378.     return 1;
  379. }
  380.  
  381. public OnPlayerStreamOut(playerid, forplayerid)
  382. {
  383.     return 1;
  384. }
  385.  
  386. public OnVehicleStreamIn(vehicleid, forplayerid)
  387. {
  388.     return 1;
  389. }
  390.  
  391. public OnVehicleStreamOut(vehicleid, forplayerid)
  392. {
  393.     return 1;
  394. }
  395.  
  396. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  397. {
  398.     new string[256];
  399.     if(dialogid == 1)
  400.     {
  401.     if(response == 0)
  402.     {
  403.     SendClientMessage(playerid, 0x989700AA, "Você saiu do servidor!");
  404.     Kick(playerid);
  405.     return 1;
  406.     }
  407.     if(response >= 1)
  408.     {
  409.     if(strlen(inputtext) == 0)
  410.     {
  411.     ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "FS login e Registro By Rangel \nDigite sua Senha para Logar!!!", "Logar", "Sair");
  412.     return 1;
  413.     }
  414.     if(strval(inputtext) > 0)
  415.     {
  416.     format(string,sizeof(string),"/logar %d",strval(inputtext));
  417.     OnPlayerCommandText(playerid,string);
  418.     return 1;
  419.     }
  420.     format(string,sizeof(string),"/logar %s",inputtext);
  421.     OnPlayerCommandText(playerid,string);
  422.     return 1;
  423.     }
  424.     return 1;
  425.     }
  426.     if(dialogid == 2)
  427.     {
  428.     if(response == 0)
  429.     {
  430.     SendClientMessage(playerid, 0x989700AA, "Você saiu do servidor!");
  431.     Kick(playerid);
  432.     return 1;
  433.     }
  434.     if(response >= 1)
  435.     {
  436.     if(strlen(inputtext) == 0)
  437.     {
  438.     ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Registrar", "FS login e Registro By Rangel \nDigite sua Senha para Registrar!!!", "Registrar", "Sair");
  439.     return 1;
  440.     }
  441.     if(strval(inputtext) > 0)
  442.     {
  443.     format(string,sizeof(string),"/registrar %d",strval(inputtext));
  444.     OnPlayerCommandText(playerid,string);
  445.     return 1;
  446.     }
  447.     format(string,sizeof(string),"/registrar %s",inputtext);
  448.     OnPlayerCommandText(playerid,string);
  449.     return 1;
  450.     }
  451.     return 1;
  452.     }
  453.     return 1;
  454. }
  455.  
  456. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  457. {
  458.     return 1;
  459. }
  460. public OnPlayerRegister(playerid, password[])
  461. {
  462.     if(IsPlayerConnected(playerid))
  463.     {
  464.             new string3[32];
  465.             new playername3[MAX_PLAYER_NAME];
  466.             new plname[MAX_PLAYER_NAME];
  467.             new string[MAX_PLAYER_NAME];
  468.             GetPlayerName(playerid, playername3, sizeof(playername3));
  469.             format(string3, sizeof(string3), "%s.ini", playername3);
  470.             new File: hFile = fopen(string3, io_write);
  471.             if (hFile)
  472.             {
  473.                 strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
  474.                 new var[32];
  475.                 format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
  476.                 format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
  477.                 format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
  478.                 format(var, 32, "SocioLevel=%d\n",PlayerInfo[playerid][pSocio]);fwrite(hFile, var);
  479.                 if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
  480.                 {
  481.                     PlayerInfo[playerid][pPos_x] = -89.7290;
  482.                     PlayerInfo[playerid][pPos_y] = 1228.7631;
  483.                     PlayerInfo[playerid][pPos_z] = 19.7422;
  484.                 }
  485.                 PlayerInfo[playerid][pLevel] = 2;
  486.                 PlayerInfo[playerid][pPos_x] = -89.7290;
  487.                 PlayerInfo[playerid][pPos_y] = 1228.7631;
  488.                 PlayerInfo[playerid][pPos_z] = 19.7422;
  489.                 PlayerInfo[playerid][pLocal] = 255;
  490.                 fclose(hFile);
  491.                 SendClientMessage(playerid, 0x4847FFAA, "Conta registrada digite : (/logar (Senha)).");
  492.                 if(gPlayerLogged[playerid] == 0)
  493.                 {
  494.                 GetPlayerName(playerid, plname, sizeof(plname));
  495.                 format(string, sizeof(string), "%s.ini", plname);
  496.                 if(fexist(string))
  497.                 {
  498.                 ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "FS login e Registro By Rangel\nDigite sua Senha para Logar!!!", "Logar", "Sair");
  499.                 }
  500.                 return 1;
  501.               }
  502.          }
  503.     }
  504.     return 1;
  505. }
  506. public OnPlayerLogin(playerid,password[])
  507. {
  508.     new tmp2[256];
  509.     new string2[64];
  510.     new playername2[MAX_PLAYER_NAME];
  511.     GetPlayerName(playerid, playername2, sizeof(playername2));
  512.     format(string2, sizeof(string2), "%s.ini", playername2);
  513.     new File: UserFile = fopen(string2, io_read);
  514.     if ( UserFile )
  515.     {
  516.         new PassData[256];
  517.         new keytmp[256], valtmp[256];
  518.         fread( UserFile , PassData , sizeof( PassData ) );
  519.         keytmp = ini_GetKey( PassData );
  520.         if( strcmp( keytmp , "Key" , true ) == 0 )
  521.         {
  522.             valtmp = ini_GetValue( PassData );
  523.             strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
  524.         }
  525.         if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
  526.         {
  527.                 new key[ 256 ] , val[ 256 ];
  528.                 new Data[ 256 ];
  529.                 while ( fread( UserFile , Data , sizeof( Data ) ) )
  530.                 {
  531.                     key = ini_GetKey( Data );
  532.                     if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
  533.                     if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
  534.                     if( strcmp( key , "AdmBrasil" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSocio] = strval( val ); }
  535.                     if( strcmp( key , "SocioLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSocio] = strval( val ); }
  536.                     logouagora[playerid] = 1;
  537.                 }//end while
  538.                 fclose(UserFile);//close the file after everything has been read in the while
  539.         }
  540.         else
  541.         {
  542.             SendClientMessage(playerid, 0xFFF540AA, "Senha errada! - Se errar a senha 6 vezes é BAN.");
  543.             new string[156];
  544.             if(fexist(string))
  545.             {
  546.             ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Senha Errada", "Senha Errada!!\nDigite a senha correta!!", "Logar", "Sair");
  547.             }
  548.             fclose(UserFile);
  549.             gPlayerLogTries[playerid] += 1;
  550.             if(gPlayerLogTries[playerid] == 6) { Ban(playerid); }
  551.             return 1;
  552.         }
  553.         ResetPlayerMoney(playerid);
  554.         format(string2, sizeof(string2), "Bem vindo %s",playername2);
  555.         SendClientMessage(playerid, 0x4847FFAA,string2);
  556.         printf("%s Foi Logado.",playername2);
  557.         format(string2, sizeof(string2), "~y~Bem Vindo ~n~~b~%s.", playername2);
  558.         GameTextForPlayer(playerid, string2, 5000, 1);
  559.         gPlayerLogged[playerid] = 1;
  560.         SpawnPlayer(playerid);
  561.         format(tmp2, sizeof(tmp2), "~p~Bem vindo ~n~~b~   %s", playername2);
  562.         GameTextForPlayer(playerid, tmp2, 5000, 1);
  563.         SendClientMessage(playerid, 0xFFF540AA, motd);
  564.         TempoLogin = SetTimerEx("LoginAgora", 10000, 0, "i", playerid);
  565.     }
  566.     return 1;
  567. }
  568. stock ini_GetKey( line[] )
  569. {
  570.     new keyRes[256];
  571.     keyRes[0] = 0;
  572.     if ( strfind( line , "=" , true ) == -1 ) return keyRes;
  573.     strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
  574.     return keyRes;
  575. }
  576.  
  577. stock ini_GetValue( line[] )
  578. {
  579.     new valRes[256];
  580.     valRes[0]=0;
  581.     if ( strfind( line , "=" , true ) == -1 ) return valRes;
  582.     strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
  583.     return valRes;
  584. }
  585. public Encrypt(string[])
  586. {
  587.     for(new x=0; x < strlen(string); x++)
  588.       {
  589.           string[x] += (3^x) * (x % 15);
  590.           if(string[x] > (0xff))
  591.           {
  592.               string[x] -= 256;
  593.           }
  594.       }
  595.     return 1;
  596. }
  597. public LoginAgora(playerid)
  598. {
  599.    if(IsPlayerConnected(playerid))
  600.    {
  601.    logouagora[playerid] = 0;
  602.    KillTimer(TempoLogin);
  603.    return 1;
  604.    }
  605.    return 1;
  606. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement