SA-MP Forums Archive
[HELP] Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: [HELP] Command (/showthread.php?tid=511640)



[HELP] Command - monster010 - 06.05.2014

pawn Код:
if(strcmp(cmd, "/gotols", true) == 0)
    {
    if(AdminDuty[playerid] == 1 || PlayerInfo[playerid][pAdmin] < 1337)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pHelper] >= 2)
            {
                if (GetPlayerState(playerid) == 2)
                {
                    new tmpcar = GetPlayerVehicleID(playerid);
                    SetVehiclePos(tmpcar, 1529.6,-1691.2,13.3);
                    TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
                }
                else
                {
                    SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
                }
                SendClientMessage(playerid, COLOR_GRAD1, "   You have been teleported !");
                SetPlayerInterior(playerid,0);
                PlayerInfo[playerid][pInt] = 0;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
            }
        }
    }
    else
     {
        SendClientMessage(playerid, COLOR_GREY, "* You must by duty. Type /aod");
        return 1;
     }
        return 1;
    }
I tried to make less than 1337 admin not be obliged to use /aod
I did well above? If is a admin > 1337 he must type the command /aod to use the /gotols?


Re: [HELP] Command - sekonoppa - 06.05.2014

Soo could you explain what is the problem you're experiencing?


Re: [HELP] Command - sekonoppa - 06.05.2014

Also there is no need for a variable like this:
Quote:

new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 1529.6,-1691.2,13.3);

As GetPlayerVehicle returns an integer it would also work like this:
Quote:

SetVehiclePos(GetPlayerVehicleID(playerid), 1529.6,-1691.2,13.3);




Re: [HELP] Command - monster010 - 06.05.2014

I'm sorry, wrong category!