makino

Untitled

Dec 28th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.92 KB | None | 0 0
  1. new ak1;
  2. new bool: AKDestruida;
  3.  
  4.  
  5.  
  6. public OnGameModeInit()
  7. {
  8.     ak1 = CreateObject(355,1301.0890,253.5772,18.5547,93.7, 120.0, 120.0); //Fará com que crie um Objeto.
  9. }
  10.  
  11.  
  12. public OnPlayerCommandText(playerid, cmdtext[])
  13. {
  14.     if(strcmp(cmdtext, "/pegar", true)== 0)
  15. {
  16.     if(IsPlayerInRangeOfPoint(playerid, 2, 1301.0890,253.5772,18.5547))
  17.     {
  18.         if(AKDestruida == false)
  19.         {
  20.             AKDestruida = true;
  21.             GivePlayerWeapon(playerid,30,100);
  22.             DestroyObject(ak1); //Destruirá o objeto criado no OnGameModeInit, o DestruirTeste..
  23.             SetTimer("CriarDenovo", 60000*10, false); //Criará um SetTimer para chamar a função de CreateObject na forward que criaremos.
  24.         }
  25. }
  26. return 1;
  27. }
  28.  
  29. forward CriarDenovo();
  30. public CriarDenovo()
  31. {
  32. ak1 = CreateObject(355,1301.0890,253.5772,18.5547,93.7, 120.0, 120.0); //Fará com que crie um Objeto.
  33. AKDestruida = true;
  34. return 1;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment