Advertisement
Guest User

Pokemon sys by wumpyc

a guest
Nov 13th, 2011
620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.21 KB | None | 0 0
  1. #include "a_samp"
  2. #include <zcmd>
  3.  
  4. new Squirtle[MAX_PLAYERS];
  5. new SquirtleTime[MAX_PLAYERS];
  6. new GotATurtle[MAX_PLAYERS];
  7. new PokemonTurtle[MAX_PLAYERS];
  8. new Cow[MAX_PLAYERS];
  9. new CowTime[MAX_PLAYERS];
  10. new GotACow[MAX_PLAYERS];
  11. new PokemonCow[MAX_PLAYERS];
  12. new Parrot[MAX_PLAYERS];
  13. new ParrotTime[MAX_PLAYERS];
  14. new GotAParrot[MAX_PLAYERS];
  15. new PokemonParrot[MAX_PLAYERS];
  16.  
  17. forward Squirtle_I_Choose_Youuuuu(playerid);
  18. public Squirtle_I_Choose_Youuuuu(playerid)
  19. {
  20.         new Float:phrr[4];
  21.         new playerstate = GetPlayerState(playerid);
  22.         if (playerstate == PLAYER_STATE_DRIVER
  23.         || playerstate == PLAYER_STATE_PASSENGER)
  24.         {
  25.         if(IsPlayerAttachedObjectSlotUsed(playerid,4))
  26.         {
  27.         SendClientMessage(playerid, 0xFF0000FF,"Are you crazy?..Turtle can't follow you when you're driving.");
  28.         SendClientMessage(playerid, 0xFF0000FF,"Turtle is in your pokč ball!");
  29.         KillTimer(SquirtleTime[playerid]);
  30.         DestroyObject(Squirtle[playerid]);
  31.         GotATurtle[playerid] = 0;
  32.         }
  33.         }
  34.         if (playerstate == PLAYER_STATE_ONFOOT)
  35.         {
  36.         GetPlayerPos(playerid, phrr[0],phrr[1],phrr[2]);
  37.         GetPlayerFacingAngle(playerid, phrr[3]);
  38.         SetObjectRot(Squirtle[playerid],0.0, 0.0, phrr[3]);
  39.         MoveObject(Squirtle[playerid], phrr[0]-3,phrr[1],phrr[2],10);
  40.         }
  41.         return 1;
  42. }
  43.  
  44. COMMAND:goturtle(playerid,params[])
  45. {
  46.     new Float:x1,Float:y1,Float:z1,Float:a;
  47.     if(IsPlayerAttachedObjectSlotUsed(playerid,4))
  48.     {
  49.     if (GotATurtle[playerid] == 0)
  50.     {
  51.     GetPlayerPos(playerid,x1,y1,z1);
  52.     GetPlayerFacingAngle(playerid, a);
  53.     Squirtle[playerid] = CreateObject(1609,x1,y1,z1-1,a,0.0,0.0);
  54.     SquirtleTime[playerid] = SetTimerEx("Squirtle_I_Choose_Youuuuu",1,true, "i", playerid);
  55.     SendClientMessage(playerid, 0x00FF00FF,"TURTLE I CHOOSE YOUU , GO!");
  56.     SendClientMessage(playerid, 0xFFFF00FF,"Now use /getturtle to get it back to pokč ball!");
  57.     GotATurtle[playerid] = 1;
  58.     }
  59.     else
  60.     {
  61.     SendClientMessage(playerid, 0xFF0000FF,"Are you blind?!?!");
  62.     }
  63.     }
  64.     else
  65.     {
  66.     SendClientMessage(playerid, 0xFF0000FF,"You dont have a turtle!");
  67.     }
  68.     return 1;
  69. }
  70. COMMAND:getturtle(playerid,params[])
  71. {
  72.         if(IsPlayerAttachedObjectSlotUsed(playerid,4))
  73.         {
  74.         if (GotATurtle[playerid] == 1)
  75.         {
  76.         SendClientMessage(playerid, 0xFFFF00FF,"Come back in pokč ball, turtle!");
  77.         KillTimer(SquirtleTime[playerid]);
  78.         DestroyObject(Squirtle[playerid]);
  79.         GotATurtle[playerid] = 0;
  80.         }
  81.         else
  82.         {
  83.         SendClientMessage(playerid, 0xFF0000FF,"First you have to call it from your pokč ball!");
  84.         }
  85.         }
  86.         else
  87.         {
  88.         SendClientMessage(playerid, 0xFF0000FF,"You dont have a turtle!");
  89.         }
  90.         return 1;
  91. }
  92.  
  93.  
  94. public OnPlayerDisconnect(playerid)
  95. {
  96.         KillTimer(SquirtleTime[playerid]);
  97.         GotATurtle[playerid] = 0;
  98.         KillTimer(CowTime[playerid]);
  99.         GotACow[playerid] = 0;
  100.         KillTimer(ParrotTime[playerid]);
  101.         GotAParrot[playerid] = 0;
  102.         return 1;
  103. }
  104.  
  105. COMMAND:buyturtle(playerid,params[])
  106. {
  107.         if (IsPlayerAttachedObjectSlotUsed(playerid, 4) == 0)
  108.         {
  109.         if (GetPlayerMoney(playerid) >= 20000)
  110.         {
  111.         SetPlayerAttachedObject(playerid, 4, 1609, 10, 0.0, 0.0,0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  112.         SendClientMessage(playerid, 0x00FF00FF,"You have bought a turtle");
  113.         SendClientMessage(playerid, 0x00FF00FF,"Now use /goturtle to call it from pokč ball!");
  114.         GivePlayerMoney(playerid, -20000);
  115.         GotATurtle[playerid] = 0;
  116.         PokemonTurtle[playerid] = 1;
  117.         }
  118.         }
  119.         {
  120.         SendClientMessage(playerid,0xFF0000FF,"You don't have enough cash!");
  121.         }
  122.         return 1;
  123. }
  124. COMMAND:sellturtle(playerid,params[])
  125. {
  126.         if(IsPlayerAttachedObjectSlotUsed(playerid,4))
  127.         {
  128.         RemovePlayerAttachedObject(playerid,4);
  129.         DestroyObject(Squirtle[playerid]);
  130.         SendClientMessage(playerid, 0x00FF00FF,"You have sold a turtle");
  131.         GivePlayerMoney(playerid, 19000);
  132.         GotATurtle[playerid] = 0;
  133.         PokemonTurtle[playerid] = 0;
  134.         }
  135.         return 1;
  136. }
  137.  
  138.  forward Cow_I_Choose_Youuuuu(playerid);
  139. public Cow_I_Choose_Youuuuu(playerid)
  140. {
  141.         new Float:phrr[4];
  142.         new playerstate = GetPlayerState(playerid);
  143.         if (playerstate == PLAYER_STATE_DRIVER
  144.         || playerstate == PLAYER_STATE_PASSENGER)
  145.         {
  146.         if(PokemonCow[playerid] == 1)
  147.         {
  148.         SendClientMessage(playerid, 0xFF0000FF,"Are you crazy?..Cow can't follow you when you're driving.");
  149.         SendClientMessage(playerid, 0xFF0000FF,"Cow is in your pokč ball!");
  150.         KillTimer(CowTime[playerid]);
  151.         DestroyObject(Cow[playerid]);
  152.         GotACow[playerid] = 0;
  153.         }
  154.         }
  155.         if (playerstate == PLAYER_STATE_ONFOOT)
  156.         {
  157.         GetPlayerPos(playerid, phrr[0],phrr[1],phrr[2]);
  158.         GetPlayerFacingAngle(playerid, phrr[3]);
  159.         SetObjectRot(Cow[playerid],0.0, 0.0, phrr[3]);
  160.         MoveObject(Cow[playerid], phrr[0]-10,phrr[1],phrr[2],10);
  161.         }
  162.         return 1;
  163. }
  164.  
  165. COMMAND:gocow(playerid,params[])
  166. {
  167.     new Float:x1,Float:y1,Float:z1,Float:a;
  168.     if(PokemonCow[playerid] == 1)
  169.     {
  170.     if (GotACow[playerid] == 0)
  171.     {
  172.     GetPlayerPos(playerid,x1,y1,z1);
  173.     GetPlayerFacingAngle(playerid, a);
  174.     Cow[playerid] = CreateObject(16442,x1-10,y1,z1-1,a,0.0,0.0);
  175.     CowTime[playerid] = SetTimerEx("Cow_I_Choose_Youuuuu",1,true, "i", playerid);
  176.     SendClientMessage(playerid, 0x00FF00FF,"COW I CHOOSE YOUU , GO!");
  177.     SendClientMessage(playerid, 0xFFFF00FF,"Now use /getcow to get it back to pokč ball!");
  178.     GotACow[playerid] = 1;
  179.     }
  180.     else
  181.     {
  182.     SendClientMessage(playerid, 0xFF0000FF,"Are you blind?!?!");
  183.     }
  184.     }
  185.     else
  186.     {
  187.     SendClientMessage(playerid, 0xFF0000FF,"You dont have a cow!");
  188.     }
  189.     return 1;
  190. }
  191. COMMAND:getcow(playerid,params[])
  192. {
  193.         if (PokemonCow[playerid] == 1)
  194.         {
  195.         if (GotACow[playerid] == 1)
  196.         {
  197.         SendClientMessage(playerid, 0xFFFF00FF,"Come back in pokč ball, cow!");
  198.         KillTimer(CowTime[playerid]);
  199.         DestroyObject(Cow[playerid]);
  200.         GotACow[playerid] = 0;
  201.         }
  202.         else
  203.         {
  204.         SendClientMessage(playerid, 0xFF0000FF,"First you have to call it from your pokč ball!");
  205.         }
  206.         }
  207.         else
  208.         {
  209.         SendClientMessage(playerid, 0xFF0000FF,"You dont have a cow!");
  210.         }
  211.         return 1;
  212. }
  213.  
  214.  
  215. COMMAND:buycow(playerid,params[])
  216. {
  217.         if (PokemonCow[playerid] == 0 && GetPlayerMoney(playerid) >= 20000)
  218.         {
  219.         SendClientMessage(playerid, 0x00FF00FF,"You have bought a cow");
  220.         SendClientMessage(playerid, 0x00FF00FF,"Now use /gocow to call it from pokč ball!");
  221.         GivePlayerMoney(playerid, -20000);
  222.         GotACow[playerid] = 0;
  223.         PokemonCow[playerid] = 1;
  224.         }
  225.         else
  226.         {
  227.         SendClientMessage(playerid,0xFF0000FF,"You don't have enough cash or you already have a cow!");
  228.         }
  229.         return 1;
  230. }
  231. COMMAND:sellcow(playerid,params[])
  232. {
  233.         if(PokemonCow[playerid] == 1)
  234.         {
  235.         DestroyObject(Cow[playerid]);
  236.         SendClientMessage(playerid, 0x00FF00FF,"You have sold a cow");
  237.         GivePlayerMoney(playerid, 19000);
  238.         GotACow[playerid] = 0;
  239.         PokemonCow[playerid] = 0;
  240.         }
  241.         return 1;
  242. }
  243.  
  244. forward Parrot_I_Choose_Youuuuu(playerid);
  245. public Parrot_I_Choose_Youuuuu(playerid)
  246. {
  247.         new Float:phrr[4];
  248.         new playerstate = GetPlayerState(playerid);
  249.         if (playerstate == PLAYER_STATE_DRIVER
  250.         || playerstate == PLAYER_STATE_PASSENGER)
  251.         {
  252.         if(PokemonParrot[playerid] == 1)
  253.         {
  254.         SendClientMessage(playerid, 0xFF0000FF,"Are you crazy?..Parrot can't follow you when you're driving.");
  255.         SendClientMessage(playerid, 0xFF0000FF,"Parrot is in your pokč ball!");
  256.         KillTimer(ParrotTime[playerid]);
  257.         DestroyObject(Parrot[playerid]);
  258.         GotAParrot[playerid] = 0;
  259.         }
  260.         }
  261.         if (playerstate == PLAYER_STATE_ONFOOT)
  262.         {
  263.         GetPlayerPos(playerid, phrr[0],phrr[1],phrr[2]);
  264.         GetPlayerFacingAngle(playerid, phrr[3]);
  265.         SetObjectRot(Parrot[playerid],0.0, -90.0, phrr[3]);
  266.         MoveObject(Parrot[playerid], phrr[0]-1,phrr[1],phrr[2]+0.5,10);
  267.         }
  268.         return 1;
  269. }
  270.  
  271. COMMAND:goparrot(playerid,params[])
  272. {
  273.     new Float:x,Float:y,Float:z;
  274.     if(PokemonParrot[playerid] == 1)
  275.     {
  276.     if (GotAParrot[playerid] == 0)
  277.     {
  278.     GetPlayerPos(playerid,x,y,z);
  279.     Parrot[playerid] = CreateObject(19079,x-1,y , z,90,0,45);
  280.     ParrotTime[playerid] = SetTimerEx("Parrot_I_Choose_Youuuuu",1,true, "i", playerid);
  281.     SendClientMessage(playerid, 0x00FF00FF,"PARROT I CHOOSE YOUU , GO!");
  282.     SendClientMessage(playerid, 0xFFFF00FF,"Now use /getparrot to get it back to pokč ball!");
  283.     GotAParrot[playerid] = 1;
  284.     }
  285.     else
  286.     {
  287.     SendClientMessage(playerid, 0xFF0000FF,"Are you blind?!?!");
  288.     }
  289.     }
  290.     else
  291.     {
  292.     SendClientMessage(playerid, 0xFF0000FF,"You dont have a parrot!");
  293.     }
  294.     return 1;
  295. }
  296. COMMAND:getparrot(playerid,params[])
  297. {
  298.         if (PokemonParrot[playerid] == 1)
  299.         {
  300.         if (GotAParrot[playerid] == 1)
  301.         {
  302.         SendClientMessage(playerid, 0xFFFF00FF,"Come back in pokč ball, parrot!");
  303.         KillTimer(ParrotTime[playerid]);
  304.         DestroyObject(Parrot[playerid]);
  305.         GotAParrot[playerid] = 0;
  306.         }
  307.         else
  308.         {
  309.         SendClientMessage(playerid, 0xFF0000FF,"First you have to call it from your pokč ball!");
  310.         }
  311.         }
  312.         else
  313.         {
  314.         SendClientMessage(playerid, 0xFF0000FF,"You dont have a parrot!");
  315.         }
  316.         return 1;
  317. }
  318.  
  319.  
  320. COMMAND:buyparrot(playerid,params[])
  321. {
  322.         if (PokemonParrot[playerid] == 0 && GetPlayerMoney(playerid) >= 20000)
  323.         {
  324.         SendClientMessage(playerid, 0x00FF00FF,"You have bought a parrot");
  325.         SendClientMessage(playerid, 0x00FF00FF,"Now use /goparrot to call it from pokč ball!");
  326.         GivePlayerMoney(playerid, -20000);
  327.         GotAParrot[playerid] = 0;
  328.         PokemonParrot[playerid] = 1;
  329.         }
  330.         else
  331.         {
  332.         SendClientMessage(playerid,0xFF0000FF,"You don't have enough cash or you already have a parrot!");
  333.         }
  334.         return 1;
  335. }
  336. COMMAND:sellparrot(playerid,params[])
  337. {
  338.         if(PokemonParrot[playerid] == 1)
  339.         {
  340.         DestroyObject(Parrot[playerid]);
  341.         SendClientMessage(playerid, 0x00FF00FF,"You have sold a parrot");
  342.         GivePlayerMoney(playerid, 19000);
  343.         GotAParrot[playerid] = 0;
  344.         PokemonParrot[playerid] = 0;
  345.         }
  346.         return 1;
  347. }
  348.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement