Advertisement
Guest User

Untitled

a guest
Aug 13th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.83 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3.     new
  4.         Float:LastX[ MAX_PLAYERS ],
  5.         Float:LastY[ MAX_PLAYERS ],
  6.         Float:LastZ[ MAX_PLAYERS ];
  7.        
  8. #define COLOR_BLUE 0xFFFFFFFFF
  9.  
  10. public OnPlayerCommandText(playerid, cmdtext[])
  11. {
  12.  
  13.     if(strcmp(cmdtext, "/afk", true) == 0) {
  14.         GetPlayerPos(playerid, LastX[ playerid ], LastY[ playerid ], LastZ[ playerid ]);
  15.         SetPlayerPos(playerid,2324.419921,-1145.568359,1050.710083);
  16.         SetPlayerInterior(playerid, 12);
  17.         new pName[MAX_PLAYER_NAME]; // Saying pName is the Players Name!
  18.         new string[128]; // Creating the string.
  19.         GetPlayerName(playerid,pName,MAX_PLAYER_NAME); // tells the pName to get the players name!
  20.         format(string, sizeof(string), "--> %s is now AFK",pName); // This is what will send to everyone!
  21.         SendClientMessageToAll(COLOR_BLUE, string); // This is what makes the "string" send in the "COLOR_BLUE"!
  22.         TogglePlayerControllable(playerid, 0); // Makes it so the player cannot move.
  23.         SetPlayerHealth(playerid, 999999.999); // Sets the players health so he is invincible! So noone can kill him.
  24.         return 1;
  25.     }
  26.     if(strcmp(cmdtext, "/back", true) == 0)
  27.     {
  28.         SetPlayerPos(playerid, LastX[ playerid ], LastY[ playerid ], LastZ[ playerid ]);
  29.         SetPlayerInterior(playerid, 0);
  30.         new pName[MAX_PLAYER_NAME]; // Saying pName is the Players Name!
  31.         new string[128]; // Creating the string.
  32.         GetPlayerName(playerid,pName,MAX_PLAYER_NAME); // tells the pName to get the players name!
  33.         format(string, sizeof(string), "--> %s is now BACK",pName); // This is what will send to everyone!
  34.         SendClientMessageToAll(COLOR_BLUE, string); // This is what makes the "string" send in the "COLOR_BLUE"!
  35.         TogglePlayerControllable(playerid, 1); // Makes it so the player can move.
  36.         SetPlayerHealth(playerid, 100); // Sets the players health back to normal. He is now killable.
  37.         return 1;
  38.     }
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement