How to make admin commands
#6

Detects if the player is in a vehicle, and brings it with him. Just login to RCON.

pawn Код:
CMD:get(playerid, params[])
{
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, red, "{FF0000}ERROR:{FFFFFF} Invalid Command, {FF0000}[/HELP] {FFFFFF}or {FF0000}[/CMDS].");
    {
        new Float:x, Float:y, Float:z, ID, string[128];
        if(sscanf(params, "u", ID)) return SendClientMessage( playerid, white, "USAGE: /get [playerid/partofname]");
        {
            if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"That player is not connected.");
            if(ID == playerid) return SendClientMessage(playerid,red,"You cannot get yourself.");
            if(GetPlayerState(ID) == PLAYER_STATE_DRIVER)
            {
                new veh = GetPlayerVehicleID(ID);
                SetPlayerVirtualWorld(ID, GetPlayerVirtualWorld(playerid));
                SetPlayerInterior(ID, GetPlayerInterior(playerid));
                GetPlayerPos(playerid,x,y,z);
                SetVehiclePos(veh,x,y+1,z);
                PutPlayerInVehicle(ID, veh, 0);
            }
            else
            {
                SetPlayerVirtualWorld(ID, GetPlayerVirtualWorld(playerid));
                SetPlayerInterior(ID, GetPlayerInterior(playerid));
                GetPlayerPos(playerid,x,y,z);
                SetPlayerPos(ID,x,y+1,z);
            }
            GetPlayerName(playerid, pname, sizeof(pname));
            format(string,sizeof(string),"You have been teleported to {FF0000}%s", pname);
            SendClientMessage(ID, white, string);
            GetPlayerName(ID, pname, sizeof(pname));
            format(string,sizeof(string),"%s{FFFFFF} has been teleported to you.", pname);
            SendClientMessage(playerid, red, string);
        }
    }
    return 1;
}
Reply


Messages In This Thread
How to make admin commands - by XDTheProGamerz - 06.11.2011, 00:24
Re: How to make admin commands - by grand.Theft.Otto - 06.11.2011, 00:26
Re: How to make admin commands - by XDTheProGamerz - 06.11.2011, 00:29
Re: How to make admin commands - by grand.Theft.Otto - 06.11.2011, 00:52
Re: How to make admin commands - by GAMER_PS2 - 06.11.2011, 01:04
Re: How to make admin commands - by Camacorn - 06.11.2011, 01:11

Forum Jump:


Users browsing this thread: 1 Guest(s)