Advertisement
Youssef_Ehab

Untitled

May 29th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. COMMAND:goto(playerid, params[])
  2. {
  3. new ID;//creates a new something idk what we call it :P but it is defined later on or used in something this 1 is used in next line
  4. if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /goto [id]");//checks if you have written something after /goto if no it sends error
  5. else if(!IsPlayerConnected(ID) || ID == playerid) return SendClientMessage(playerid, 0xFF0000FF, "You can't teleport to that player right now!");
  6. if(GotoDisabled[ID] == 1)
  7. {
  8. new string[50], name[MAX_PLAYER_NAME];
  9. format(string, sizeof(string), "%s's goto is disabled!", GetPlayerName(playerid, name, sizeof(name)));
  10. GameTextForPlayer(playerid,string,2000,3);
  11. }
  12. else
  13. {
  14. if(PlayerInfo[playerid][AdminLevel] >= LEVEL_goto1)
  15. {
  16. new Float:x, Float:y, Float:z;//creates new floats
  17. GetPlayerPos(ID, x, y, z);//gets the player id(which we have entered after /goto position and like saves them into x,y,z defined above as floats
  18. SetPlayerPos(playerid, x+1, y+1, z);//sets the player position the id of that player +1 in x +1 in y and z remains same as it defines height
  19. }
  20. return 1;
  21. }
  22. if(GotoDisabled[ID] == 0)
  23. {
  24. if(PlayerInfo[playerid][AdminLevel] >= LEVEL_goto2){
  25. new Float:x, Float:y, Float:z;//creates new floats
  26. GetPlayerPos(ID, x, y, z);//gets the player id(which we have entered after /goto position and like saves them into x,y,z defined above as floats
  27. SetPlayerPos(playerid, x+1, y+1, z);//sets the player position the id of that player +1 in x +1 in y and z remains same as it defines height
  28. }
  29. }
  30. return 1;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement