MuhammadZeeshan

goto cmd

Dec 22nd, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. else if ( ( cmd == "goto" ) || ( cmd == "tele" ) )
  2. {
  3. local plr = player.ID;
  4. if ( status[ player.ID ].Registered == false ) ErrorMessage( "[#FFFFFF]You need to be a part of our community to use this command.", player );
  5. else if ( status[ player.ID ].Logged == false ) ErrorMessage( "[#FFFFFF]You need to be identified to use this command.", player );
  6. else if ( LMSS[ plr ].IsLMS == true ) ErrorMessage("The player is in LMS, you can't teleport..", player );
  7. else if ( LMSS[ player.ID ].IsLMS == true ) ErrorMessage("You cannot use this command while in LMS", player );
  8. else if ( status[ player.ID ].Duel == true ) ErrorMessage("You cannot use this command while in duel zone", player );
  9. else if ( status[ player.ID ].gungame == true ) ErrorMessage("You cannot use this command while in gungame", player );
  10. else if ( status[ plr ].Duel == true ) ErrorMessage("The player is in duel zone, you cannot teleport.", player );
  11. else if ( status[ plr ].gungame == true ) ErrorMessage("The player is in gungame, you cannot teleport.", player);
  12. else if ( !player.IsSpawned ) ErrorMessage("[#008000][Server] - [#FFFFFF]You need to be spawned to use this command.", player );
  13. else if ( !text ) ErrorMessage( "[#FF0000][SYNTAX] - [#FFFFFF]/" + cmd + " <Player/ID>", player );
  14. else if ( player.Cash < 100 ) ErrorMessage( "[#FFFFFF]You need atleast $100 to use this commad.", player );
  15. else
  16. {
  17. local plr = GetPlayer( GetTok(text, " ", 1) ),
  18. query = QuerySQL(db, "SELECT Nogoto FROM Accounts WHERE Name = '"+plr.Name+"'" );
  19.  
  20. if ( !plr ) ErrorMessage("[#FFFFFF]The player is not online.", player );
  21. else if ( !plr.IsSpawned ) ErrorMessage("[#FFFFFF]The player is not spawned yet.", player );
  22. else if ( GetSQLColumnData( query, 0 ) == "on" ) ErrorMessage("[#FFFFFF]The player has turned his nogoto on!.", player );
  23. else if ( plr.ID == player.ID ) ErrorMessage("[#FFFFFF]You can not teleport to yourself.", player );
  24. else
  25. {
  26. NewTimer( "Teleport", 5000, 1, player.ID, plr.ID );
  27. Announce( "~b~ Teleporting.", player, 6 );
  28. player.IsFrozen = true;
  29. SendMessage("You will be teleported to "+plr.Name+" in 5 seconds to prevent death evasion.", player );
  30. SendMessage(RED+"[ALERT]: "+player.Name+" is trying to teleporting to you in 5 seconds. ", plr );
  31. }
  32. FreeSQLQuery( query );
  33. }
  34. }
Add Comment
Please, Sign In to add comment