afk / back system
#2

pawn Код:
new
        Float:LastX[ MAX_PLAYERS ],
        Float:LastY[ MAX_PLAYERS ],
        Float:LastZ[ MAX_PLAYERS ];

    if(strcmp(cmdtext, "/afk", true) == 0) {
        GetPlayerPos(playerid, LastX[ playerid ], LastY[ playerid ], LastZ[ playerid ]);
        SetPlayerPos(playerid,2324.419921,-1145.568359,1050.710083);
        SetPlayerInterior(playerid, 12);
        new pName[MAX_PLAYER_NAME]; // Saying pName is the Players Name!
        new string[128]; // Creating the string.
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME); // tells the pName to get the players name!
        format(string, sizeof(string), "--> %s is now AFK",pName); // This is what will send to everyone!
        SendClientMessageToAll(COLOR_BLUE, string); // This is what makes the "string" send in the "COLOR_BLUE"!
        TogglePlayerControllable(playerid, 0); // Makes it so the player cannot move.
        SetPlayerHealth(playerid, 999999.999); // Sets the players health so he is invincible! So noone can kill him.
        return 1;
    }
    if(strcmp(cmdtext, "/back", true) == 0)
    {
        SetPlayerPos(playerid, LastX[ playerid ], LastY[ playerid ], LastZ[ playerid ]);
        SetPlayerInterior(playerid, 0);
        new pName[MAX_PLAYER_NAME]; // Saying pName is the Players Name!
        new string[128]; // Creating the string.
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME); // tells the pName to get the players name!
        format(string, sizeof(string), "--> %s is now BACK",pName); // This is what will send to everyone!
        SendClientMessageToAll(COLOR_BLUE, string); // This is what makes the "string" send in the "COLOR_BLUE"!
        TogglePlayerControllable(playerid, 1); // Makes it so the player can move.
        SetPlayerHealth(playerid, 100); // Sets the players health back to normal. He is now killable.
        return 1;
    }
Reply


Messages In This Thread
afk / back system - by Zonoya - 13.08.2011, 15:20
Re: afk / back system - by Raimis_R - 13.08.2011, 15:26
Re: afk / back system - by Zonoya - 13.08.2011, 15:28
Re: afk / back system - by Raimis_R - 13.08.2011, 15:37
Re: afk / back system - by Zonoya - 13.08.2011, 15:57
Re: afk / back system - by Raimis_R - 13.08.2011, 16:08
Re: afk / back system - by Zonoya - 13.08.2011, 16:11
Re: afk / back system - by Raimis_R - 13.08.2011, 16:13
Re: afk / back system - by Zonoya - 13.08.2011, 16:15
Re: afk / back system - by Zonoya - 13.08.2011, 16:17
Re: afk / back system - by Raimis_R - 13.08.2011, 16:24
Re: afk / back system - by Zonoya - 13.08.2011, 16:33

Forum Jump:


Users browsing this thread: 1 Guest(s)