Advertisement
Gireada

Sistem Haine

Jan 28th, 2013
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 8.09 KB | None | 0 0
  1. /*
  2.                                                                             Sistem de haine
  3.                                                                                by Gireada
  4.                                                             Don't remove the credits. Nu stergeti creditele.
  5.                                                                 Contact:gireada09(skype,messenger,live)
  6.                    
  7. */
  8. #include <a_samp>
  9. #include <dini>
  10. #include <zcmd>
  11.  
  12. new cloth[MAX_PLAYERS];
  13. new changecloth[MAX_PLAYERS];
  14. new Gnextskin[MAX_PLAYERS];
  15. new PlayerText:Gireada0[MAX_PLAYERS];
  16. new PlayerText:Gireada1[MAX_PLAYERS];
  17. new PlayerText:Gireada2[MAX_PLAYERS];
  18. new PlayerText:Gireada3[MAX_PLAYERS];
  19. new PlayerText:Gireada4[MAX_PLAYERS];
  20. new PlayerText:Gireada5[MAX_PLAYERS];
  21.  
  22. enum PlayerData
  23. {
  24.     pSkin,
  25. }
  26.  
  27. new PlayerInfo[MAX_PLAYERS][PlayerData];
  28.  
  29. stock pName(playerid)
  30. {
  31.     new name[MAX_PLAYER_NAME];
  32.     GetPlayerName(playerid,name,sizeof(name));
  33.     return name;
  34. }
  35.  
  36. public OnFilterScriptInit()
  37. {
  38.     print("\n--------------------------------------");
  39.     print(" Sistem de haine by Gireada");
  40.     print("--------------------------------------\n");
  41.    
  42.     return 1;
  43. }
  44.  
  45. public OnFilterScriptExit()
  46. {
  47.     return 1;
  48. }
  49.  
  50. main()
  51. {
  52.     print("\n----------------------------------");
  53.     print(" Sistem de haine by Gireada");
  54.     print("----------------------------------\n");
  55. }
  56.  
  57. public OnPlayerConnect(playerid)
  58. {
  59.     new file[30];
  60.     format(file, sizeof(file),"JucatoriSkin/%s.ini", pName(playerid));
  61.     if(dini_Exists(file))
  62.     {
  63.         PlayerInfo[playerid][pSkin] = dini_Int(file,"Skin");
  64.     }
  65.     else if(!dini_Exists(file))
  66.     {
  67.         dini_Create(file);
  68.         dini_IntSet(file,"Skin",PlayerInfo[playerid][pSkin] = 0);
  69.     }
  70.     cloth[playerid] = 0;
  71.     Gireada0[playerid] = CreatePlayerTextDraw(playerid, 199.500000, 204.312500, "Prev");
  72.     PlayerTextDrawLetterSize(playerid, Gireada0[playerid], 0.449999, 1.600000);
  73.     PlayerTextDrawAlignment(playerid, Gireada0[playerid], 1);
  74.     PlayerTextDrawColor(playerid, Gireada0[playerid], -1);
  75.     PlayerTextDrawSetShadow(playerid, Gireada0[playerid], 0);
  76.     PlayerTextDrawSetOutline(playerid, Gireada0[playerid], 1);
  77.     PlayerTextDrawBackgroundColor(playerid, Gireada0[playerid], 51);
  78.     PlayerTextDrawFont(playerid, Gireada0[playerid], 1);
  79.     PlayerTextDrawSetProportional(playerid, Gireada0[playerid], 1);
  80.     PlayerTextDrawSetSelectable(playerid, Gireada0[playerid], true);
  81.  
  82.     Gireada1[playerid] = CreatePlayerTextDraw(playerid, 260.000000, 189.625000, "usebox");
  83.     PlayerTextDrawLetterSize(playerid, Gireada1[playerid], 0.000000, 4.787499);
  84.     PlayerTextDrawTextSize(playerid, Gireada1[playerid], 178.000000, 0.000000);
  85.     PlayerTextDrawAlignment(playerid, Gireada1[playerid], 1);
  86.     PlayerTextDrawColor(playerid, Gireada1[playerid], 0);
  87.     PlayerTextDrawUseBox(playerid, Gireada1[playerid], true);
  88.     PlayerTextDrawBoxColor(playerid, Gireada1[playerid], 102);
  89.     PlayerTextDrawSetShadow(playerid, Gireada1[playerid], 0);
  90.     PlayerTextDrawSetOutline(playerid, Gireada1[playerid], 0);
  91.     PlayerTextDrawFont(playerid, Gireada1[playerid], 0);
  92.  
  93.     Gireada2[playerid] = CreatePlayerTextDraw(playerid, 392.500000, 201.250000, "Next");
  94.     PlayerTextDrawLetterSize(playerid, Gireada2[playerid], 0.449999, 1.600000);
  95.     PlayerTextDrawAlignment(playerid, Gireada2[playerid], 1);
  96.     PlayerTextDrawColor(playerid, Gireada2[playerid], -1);
  97.     PlayerTextDrawSetShadow(playerid, Gireada2[playerid], 0);
  98.     PlayerTextDrawSetOutline(playerid, Gireada2[playerid], 1);
  99.     PlayerTextDrawBackgroundColor(playerid, Gireada2[playerid], 51);
  100.     PlayerTextDrawFont(playerid, Gireada2[playerid], 1);
  101.     PlayerTextDrawSetProportional(playerid, Gireada2[playerid], 1);
  102.     PlayerTextDrawSetSelectable(playerid, Gireada2[playerid], true);
  103.  
  104.     Gireada3[playerid] = CreatePlayerTextDraw(playerid, 461.000000, 185.687500, "usebox");
  105.     PlayerTextDrawLetterSize(playerid, Gireada3[playerid], 0.000000, 5.127777);
  106.     PlayerTextDrawTextSize(playerid, Gireada3[playerid], 372.000000, 0.000000);
  107.     PlayerTextDrawAlignment(playerid, Gireada3[playerid], 1);
  108.     PlayerTextDrawColor(playerid, Gireada3[playerid], 0);
  109.     PlayerTextDrawUseBox(playerid, Gireada3[playerid], true);
  110.     PlayerTextDrawBoxColor(playerid, Gireada3[playerid], 102);
  111.     PlayerTextDrawSetShadow(playerid, Gireada3[playerid], 0);
  112.     PlayerTextDrawSetOutline(playerid, Gireada3[playerid], 0);
  113.     PlayerTextDrawFont(playerid, Gireada3[playerid], 0);
  114.  
  115.     Gireada4[playerid] = CreatePlayerTextDraw(playerid, 305.000000, 332.062500, "Done");
  116.     PlayerTextDrawLetterSize(playerid, Gireada4[playerid], 0.449999, 1.600000);
  117.     PlayerTextDrawAlignment(playerid, Gireada4[playerid], 1);
  118.     PlayerTextDrawColor(playerid, Gireada4[playerid], -1);
  119.     PlayerTextDrawSetShadow(playerid, Gireada4[playerid], 0);
  120.     PlayerTextDrawSetOutline(playerid, Gireada4[playerid], 1);
  121.     PlayerTextDrawBackgroundColor(playerid, Gireada4[playerid], 51);
  122.     PlayerTextDrawFont(playerid, Gireada4[playerid], 1);
  123.     PlayerTextDrawSetProportional(playerid, Gireada4[playerid], 1);
  124.     PlayerTextDrawSetSelectable(playerid, Gireada4[playerid], true);
  125.  
  126.     Gireada5[playerid] = CreatePlayerTextDraw(playerid, 362.500000, 322.187500, "usebox");
  127.     PlayerTextDrawLetterSize(playerid, Gireada5[playerid], 0.000000, 4.398611);
  128.     PlayerTextDrawTextSize(playerid, Gireada5[playerid], 285.000000, 0.000000);
  129.     PlayerTextDrawAlignment(playerid, Gireada5[playerid], 1);
  130.     PlayerTextDrawColor(playerid, Gireada5[playerid], 0);
  131.     PlayerTextDrawUseBox(playerid, Gireada5[playerid], true);
  132.     PlayerTextDrawBoxColor(playerid, Gireada5[playerid], 102);
  133.     PlayerTextDrawSetShadow(playerid, Gireada5[playerid], 0);
  134.     PlayerTextDrawSetOutline(playerid, Gireada5[playerid], 0);
  135.     PlayerTextDrawFont(playerid, Gireada5[playerid], 0);
  136.     return 1;
  137. }
  138.  
  139. public OnPlayerDisconnect(playerid, reason)
  140. {
  141.     new file[30];
  142.     cloth[playerid] = 0;
  143.     format(file, sizeof(file),"JucatoriSkin/%s.ini", pName(playerid));
  144.     dini_IntSet(file,"Skin",PlayerInfo[playerid][pSkin]);
  145.     return 1;
  146. }
  147.  
  148.  
  149. public OnPlayerSpawn(playerid)
  150. {
  151.     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  152.     return 1;
  153. }
  154.  
  155. CMD:skin(playerid, params[])
  156. {
  157.     if(changecloth[playerid] == 0)
  158.     {
  159.         changecloth[playerid] = 1;
  160.         SetPlayerPos(playerid,403.9533,2440.8496,16.4953); SetPlayerFacingAngle( playerid, 7.0964);
  161.         SetPlayerCameraPos(playerid, 404.3037, 2446.9883, 17.3881);
  162.         SetPlayerCameraLookAt(playerid, 404.2586, 2445.9846, 17.2731);
  163.         Gnextskin[playerid] = 0;SelectTextDraw(playerid, 0x00FF00FF); TogglePlayerControllable(playerid,0);
  164.         PlayerTextDrawShow(playerid, Gireada0[playerid]);
  165.         PlayerTextDrawShow(playerid, Gireada1[playerid]);
  166.         PlayerTextDrawShow(playerid, Gireada2[playerid]);
  167.         PlayerTextDrawShow(playerid, Gireada3[playerid]);
  168.         PlayerTextDrawShow(playerid, Gireada4[playerid]);
  169.         PlayerTextDrawShow(playerid, Gireada5[playerid]);
  170.     }
  171.     else
  172.     {
  173.         SendClientMessage(playerid, 0xFFFFFFAA, "Iti alegi deja hainele.");
  174.     }
  175.     return 1;
  176. }
  177.  
  178. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  179. {
  180.     if(playertextid == Gireada0[playerid])
  181.     {
  182.         Gnextskin[playerid] -= 1;SetPlayerSkin(playerid, Gnextskin[playerid]);
  183.         if(Gnextskin[playerid] == 0)
  184.         {
  185.             Gnextskin[playerid] = 299;SetPlayerSkin(playerid, Gnextskin[playerid]);
  186.         }
  187.     }
  188.     if(playertextid == Gireada2[playerid])
  189.     {
  190.         Gnextskin[playerid] += 1;SetPlayerSkin(playerid, Gnextskin[playerid]);
  191.         if(Gnextskin[playerid] == 299)
  192.         {
  193.             Gnextskin[playerid] = 1;SetPlayerSkin(playerid, Gnextskin[playerid]);
  194.         }
  195.     }
  196.     if(playertextid == Gireada4[playerid])
  197.     {
  198.          SendClientMessage(playerid, 0xFFFFFFAA, "Felicitari pentru hainele alese. Tea costat 50$");
  199.          GivePlayerMoney(playerid, -50);
  200.          PlayerInfo[playerid][pSkin] = Gnextskin[playerid];
  201.          CancelSelectTextDraw(playerid);changecloth[playerid] = 0;
  202.          SetPlayerInterior(playerid, 0); SetCameraBehindPlayer(playerid);
  203.          PlayerTextDrawHide(playerid, Gireada0[playerid]);
  204.          PlayerTextDrawHide(playerid, Gireada1[playerid]);
  205.          PlayerTextDrawHide(playerid, Gireada2[playerid]);
  206.          PlayerTextDrawHide(playerid, Gireada3[playerid]);
  207.          PlayerTextDrawHide(playerid, Gireada4[playerid]);
  208.          PlayerTextDrawHide(playerid, Gireada5[playerid]);
  209.          TogglePlayerControllable(playerid,1);
  210.     }
  211.     return 1;
  212. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement