Badyx

Sistema de ver desafios

Sep 20th, 2012
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.59 KB | None | 0 0
  1. /*
  2.         Sistema de ver desafio con spawns random By Badyx
  3.  
  4.  
  5.                         TIEMPO          6 MINUTOS
  6.                         FECHA           21/09/2012
  7.                                                         */
  8. #include <a_samp>
  9. new bool:ViendoDesafio[MAX_PLAYERS];
  10. new bool:FueaDesafio[MAX_PLAYERS];
  11.  
  12. new Float:SpawnRandom[2][3] = {
  13. {1958.3783,1343.1572,15.3746},
  14. {1705.2347,1025.6808,10.8203}
  15. };
  16.  
  17. #if defined FILTERSCRIPT
  18. #else
  19.  
  20. main()
  21. {
  22.     print(" Sistema de ver desafio con spawns random By Badyx");
  23. }
  24.  
  25. #endif
  26.  
  27. public OnPlayerConnect(playerid)
  28. {
  29.     ViendoDesafio[playerid] = false;
  30.     FueaDesafio[playerid] = false;
  31.     return 1;
  32. }
  33.  
  34. public OnPlayerDisconnect(playerid, reason)
  35. {
  36.     ViendoDesafio[playerid] = false;
  37.     FueaDesafio[playerid] = false;
  38.     return 1;
  39. }
  40.  
  41. public OnPlayerCommandText(playerid, cmdtext[])
  42. {
  43.     if (ViendoDesafio[playerid] == true)
  44.     {
  45.     if (strcmp("/salirdesafio", cmdtext, true, 10) == 0)
  46.     {
  47.     SendClientMessage(playerid, -1, " {98CDFF}Saliste {FFFFFF}del {FFA4CB}desafio");
  48.     TogglePlayerControllable(playerid, 1);
  49.     ViendoDesafio[playerid] = false;
  50.     FueaDesafio[playerid] = false;
  51.     new rand = random(sizeof(SpawnRandom));
  52.     SetPlayerPos(playerid, SpawnRandom[rand][0], SpawnRandom[rand][1], SpawnRandom[rand][2]); // Warp the player
  53.  
  54.     return 1;
  55.     }
  56.    
  57.     SendClientMessage(playerid, -1, " {98CDFF}No puedes usar comandos {FFFFFF}mientras eres espectador de un desafio. Usa{FFA4CB}/salirdesafio");
  58.     return 1;
  59.     }
  60.    
  61.  
  62.     if (strcmp("/VerDesafio", cmdtext, true, 10) == 0)
  63.     {
  64.     if (ViendoDesafio[playerid] == false)
  65.     {
  66.         //SetPlayerPos(playerid,COORDENADASX,COORDENADASY,COORDENADASZ);
  67.         SendClientMessage(playerid, -1, " {98CDFF}Fuiste como {FFFFFF}espectador al {FFA4CB}desafio");
  68.         ViendoDesafio[playerid] = true;
  69.         FueaDesafio[playerid] = true;
  70.         return 1;
  71.         }
  72.     return SendClientMessage(playerid, -1, " {98CDFF}Usted ya esta como {FFFFFF}espectador en el {FFA4CB}desafio");
  73.     }
  74.     return 0;
  75. }
  76.  
  77. public OnPlayerUpdate(playerid)
  78. {
  79.     if (ViendoDesafio[playerid] == true)
  80.     {
  81.     TogglePlayerControllable(playerid, 0);
  82.     ResetPlayerWeapons(playerid);
  83.     return 1;
  84.     }
  85.     return 1;
  86. }
  87.  
  88. //============================================================================//
  89. //                                                                            //
  90. //                               FINAL DEL SCRIPT                             //
  91. //                                                                            //
  92. //                  SI TE SIRVIO RESPETA EL TRABAJO DEL CREADOR               //
  93. //                                                                            //
  94. //============================================================================//
Advertisement
Add Comment
Please, Sign In to add comment