Advertisement
Guest User

Comanda /GOTO

a guest
Apr 25th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. /*==============================================================================
  2. Comanda: /goto
  3. ==============================================================================*/
  4. CMD:goto(playerid,params[])
  5. {
  6. if(IsPlayerConnected(playerid))
  7. {
  8. if(gPlayerLogged[playerid] != 0)
  9. {
  10. new Float:PosX, Float:PosY, Float:PosZ, Float:PosIDX, Float:PosIDY, Float:PosIDZ, string[256], sendername[MAX_PLAYER_NAME], giveplayername[MAX_PLAYER_NAME], ID;
  11. if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, ""PORTOCALIU"Scrie: "ALBASTRU2"/goto [Player ID]");
  12. GetPlayerName(playerid, sendername, sizeof(sendername));
  13. GetPlayerName(ID, giveplayername, sizeof(giveplayername));
  14. if(IsPlayerConnected(ID))
  15. {
  16. if(ID != INVALID_PLAYER_ID)
  17. {
  18. if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
  19. {
  20. GetPlayerPos(ID, PosIDX, PosIDY, PosIDZ);
  21. if (GetPlayerState(playerid) == 2 || GetPlayerState(playerid) == 3)
  22. {
  23. new tmpcar = GetPlayerVehicleID(playerid);
  24. SetVehiclePos(tmpcar, PosIDX, PosIDY + 4, PosIDZ);
  25. TelePos[playerid][0] = 0.0; TelePos[playerid][1] = 0.0;
  26. LinkVehicleToInterior(tmpcar, GetPlayerInterior(ID));
  27. SetVehicleVirtualWorld(tmpcar, GetPlayerVirtualWorld(ID));
  28. SetPlayerInterior(playerid, GetPlayerInterior(ID));
  29. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(ID));
  30.  
  31. }
  32. else
  33. {
  34. SetPlayerPos(playerid, PosIDX, PosIDY + 2, PosIDZ);
  35. SetPlayerInterior(playerid, GetPlayerInterior(ID));
  36. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(ID));
  37. }
  38. format(string, 256, ""GRI3"You have been teleported to: %s", giveplayername);
  39. SendClientMessage(playerid, -1, string);
  40. format(string, 256, ""PORTOCALIU"Admin Warning: "GALBEN"%s a folosit comanda "VERDE"/goto "GALBEN"si s-a teleportat la %s", sendername, giveplayername);
  41. AdminsMessage(-1, string);
  42. format(string, 256, ""PORTOCALIU"Helper Warning: "GALBEN"%s a folosit comanda "VERDE"/goto "GALBEN"si s-a teleportat la %s", sendername, giveplayername);
  43. HeadHelpersMessage(-1, string);
  44. GetPlayerPos(playerid, PosX, PosY, PosZ);
  45. GBPosX[playerid] = PosX;
  46. GBPosY[playerid] = PosY;
  47. GBPosZ[playerid] = PosZ;
  48. }
  49. else return SendClientMessage(playerid, -1, ""ALBASTRU2"Nu ai autorizatia sa folosesti aceasta comanda !");
  50. }
  51. }
  52. else return SendClientMessage(playerid, -1, ""GRI3"Acest player nu este conectat");
  53. }
  54. else return SendClientMessage(playerid, -1, ""ALBASTRU2"Nu esti conectat !");
  55. }
  56. return 1;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement