Advertisement
Guest User

[FS]Sistema de Transporte[By:Panico]

a guest
Jul 25th, 2012
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.85 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4.  
  5. new TPOnOff[MAX_PLAYERS];
  6.  
  7. public OnFilterScriptInit()
  8. {
  9.     print(" -- Sistema de Teleporte By: Panico -- ");
  10.     return 1;
  11. }
  12.  
  13. public OnFilterScriptExit()
  14. {
  15.     return 1;
  16. }
  17.  
  18. public OnPlayerConnect(playerid)
  19. {
  20.     TPOnOff[playerid] = 0;
  21.     return 1;
  22. }
  23.  
  24. public OnPlayerDisconnect(playerid, reason)
  25. {
  26.     TPOnOff[playerid] = 0;
  27.     return 1;
  28. }
  29. CMD:tpon(playerid, params[])
  30. {
  31.     TPOnOff[playerid] = 1;
  32.     SendClientMessage(playerid, 0x999999FF, "Vc {FF0000}Ativou{999999} o Teleporte!Agora Qualquer Player Pode Se Teleportar ate vc");
  33.     SendClientMessage(playerid, 0x999999FF, "Para desativar use: {FF0000}/tpoff");
  34.     return 1;
  35. }
  36. CMD:tpoff(playerid, params[])
  37. {
  38.     TPOnOff[playerid] = 0;
  39.     SendClientMessage(playerid, 0x999999FF, "Vc {FF0000}Desativou {999999}o Teleporte!Agora os Player nao Podem mais Se Teleportar ate vc");
  40.     SendClientMessage(playerid, 0x999999FF, "Para Ativar use: {FF0000}/tpon");
  41.     return 1;
  42. }
  43. CMD:tp(playerid, params[])
  44. {
  45.     new ID;
  46.     new String[250];
  47.     if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0x999999FF, "Use /tp [{FF0000}ID{999999}]");
  48.     if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0x999999FF, "ID invalido");
  49.     if(TPOnOff[ID] == 1)
  50.     {
  51.         new Float:x, Float:y, Float:z;
  52.         GetPlayerPos(ID, x, y, z);
  53.         SetPlayerPos(playerid, x, y, z);
  54.         format(String, sizeof(String), "O Player {FF0000}%s {999999}veio até você!", nome(playerid));
  55.         SendClientMessage(ID, 0x999999FF, String);
  56.         format(String, sizeof(String), "Vc foi ate o Player {FF0000}%s", nome(ID));
  57.         SendClientMessage(playerid, 0x999999FF, String);
  58.     }
  59.     else return SendClientMessage(ID, 0x999999FF, "O Player esta com o Teleporte {FF0000}Desativado");
  60.     return 1;
  61. }
  62. stock nome(playerid)
  63. {
  64.     new pnome[MAX_PLAYER_NAME];
  65.     GetPlayerName(playerid, pnome, 24);
  66.     return pnome;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement