Help with flip <playerid>
#1

Hi there, I'm using sscanf2 and trying to make the command /flip <playerid> for admins and if your not an admin: /flip
How can I make it that it for admins /flip <playerid> and that they can flip themself ofcourse. and for normal players only: /flip?

Someone please help.

Current command:
pawn Код:
COMMAND:flip(playerid, params[])
{
    // Send the command to all admins so they can see it
    SendAdminText(playerid, "/flip", params);

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Setup some local variables
        new Float:x = 0.0, Float:y = 0.0, Float:z = 0.0;
        // Check if the player is inside a vehicle
        if(IsPlayerInAnyVehicle(playerid))
            SetCameraBehindPlayer(playerid);
        // Get the player's position
        GetPlayerPos(playerid, x, y, z);
        // Set the vehicle on the player's coordinates
        SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
        // Let the vehicle point north
        SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
    }
    else
        return 0;

    // Let the server know that this was a valid command
    return 1;
}
Reply
#2

if(IsPlayerAdmin)
{

}
else
{

}
Reply
#3

pawn Код:
COMMAND:flip(playerid, params[])
{
    new ID;
    SendAdminText(playerid, "/flip", params);
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if(sscanf(params, "u", ID))
        {
            new Float:x = 0.0, Float:y = 0.0, Float:z = 0.0;
            if(IsPlayerInAnyVehicle(playerid))
            {
                SetCameraBehindPlayer(playerid);
                GetPlayerPos(playerid, x, y, z);
                SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
                SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
             }
             else SendClientMessage(playerid, 0xFF0000FF, "Error: {008000}You are not in a car");
        }
        else
        {
            if(IsPlayerAdmin(playerid))
            {
                new Float:x = 0.0, Float:y = 0.0, Float:z = 0.0;
                if(IsPlayerInAnyVehicle(ID))
                {
                    SetCameraBehindPlayer(ID);
                    GetPlayerPos(ID, x, y, z);
                    SetVehiclePos(GetPlayerVehicleID(ID), x, y, z);
                    SetVehicleZAngle(GetPlayerVehicleID(ID), 0.0);
                 }
                 else SendClientMessage(playerid, 0xFF0000FF, "Error: {008000}The player is not in a car");
                return 1;
            }
        }
        return 1;
    }
    else
        return SendClientMessage(playerid, 0xFF0000FF, "Error: {008000}You are not logged in");
}
For RCON admins only, untested.
@Rob_Maate, learn to script and don't confuse others.
Reply
#4

Reconfigured it with my admin system gonna test it now.
Reply
#5

Are you fucking retarded? LMAO
Yeah I was on a phone before so I typed it quickly.
Maybe YOU should learn to script.

pawn Код:
COMMAND:flip(playerid, params[])
{
    new ID;
    SendAdminText(playerid, "/flip", params);
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if(IsPlayerAdmin(playerid))
        {
            if(sscanf(params, "u", ID))
            {
                new Float:x = 0.0, Float:y = 0.0, Float:z = 0.0;
                if(IsPlayerInAnyVehicle(ID))
                {
                    SetCameraBehindPlayer(ID);
                    GetPlayerPos(ID, x, y, z);
                    SetVehiclePos(GetPlayerVehicleID(ID), x, y, z);
                    SetVehicleZAngle(GetPlayerVehicleID(ID), 0.0);
                    return 1;
                }
            }
            else
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetCameraBehindPlayer(playerid);
                    GetPlayerPos(playerid, x, y, z);
                    SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
                    SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, 0xFF0000FF, "Error: {008000}You are not in a car");
                    return 1;
                }
            }
        }
        else
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                SetCameraBehindPlayer(playerid);
                GetPlayerPos(playerid, x, y, z);
                SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
                SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, 0xFF0000FF, "Error: {008000}You are not in a car");
                return 1;
            }
        }
    }
    else return SendClientMessage(playerid, 0xFF0000FF, "Error: {008000}You are not logged in");
    return 1;
}
Reply
#6

Quote:
Originally Posted by Rob_Maate
Посмотреть сообщение
Are you fucking retarded? LMAO
Yeah I was on a phone before so I typed it quickly.
Maybe YOU should learn to script.

*code*
And what did u change in it, sir?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)