/gotopos command
#1

Can anyone give me a gotopos command for admin level 1? made with zcmd if possible please ?!
Reply
#2

Please provide more information as we do not have your admin variable for example.
Reply
#3

OK , sorry ! This is for /gotols command

// = Comanda: /gotols
//================================================== ================================================== ================================================== =======
pawn Код:
if(strcmp(cmd, "/gotols", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1 || 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, ""#GAlbastru"[Suceava-RPG]: {ffd700}Ai fost Teleportat cu succes.");
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, 256, ""#GAlbastru"[Suceava-RPG]: {ffffff}Admin {059e42}[%s]{ffffff} a folosit comanda {f70f0f}[/gotols]", sendername);
                SendAdminMessage(COLOR_LIGHTRED,string);
                SetPlayerInterior(playerid,0);
                PlayerInfo[playerid][pInt] = 0;
                SetPlayerVirtualWorld(playerid, 0);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, ""#GAlbastru"[Suceava-RPG]: {ffffff}Ne pare rau, dar nu ai acces la aceasta comanda.");
            }
        }
        return 1;
    }
Reply
#4

pawn Код:
CMD:gotopos(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new targetid;
        if(sscanf(params, "u", targetid)) SendClientMessage(playerid,-1,""chat" /gotopos [playerid]");
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");

        new Float:x,Float:y,Float:z,inter;
        GetPlayerPos(targetid,Float:x,Float:y,Float:z);
        inter = GetPlayerInterior(targetid);
        SetPlayerPosEx(playerid,Float:x,Float:y,Float:z,inter,0);
    }
    else {
        SendClientMessage(playerid,-1,""chat""COL_GREY" You cannot use this command");
    }
    return 1;
}
Try this as I didn't test it.
You need ZCMD and SSCANF includes.
Reply
#5

Quote:

CMD:goto(playerid, params[], help)//LVL1
{
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Aren't An"COLOR_RED" Admin!");
new pplayerid,Float:Pos[3];
if(sscanf(params, "u", pplayerid)) return SendClientMessage(playerid,-1,""COLOR_RED"<<Usage>>"COLOR_WHITE" /goto [Player ID/Player Name]");
if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" Wrong Player"COLOR_RED" ID!");
GetPlayerPos(pplayerid,Pos[0],Pos[1],Pos[2]);
SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
SetPlayerInterior(playerid,GetPlayerInterior(pplay erid));
return 1;
}
CMD:gotopos(playerid, params[], help)//LVL1
{
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Aren't An"COLOR_RED" Admin!");
new Float:Pos[3],int;
if(sscanf(params, "fffi",Pos[0],Pos[1],Pos[2],int)) return SendClientMessage(playerid,-1,""COLOR_RED"<<Usage>>"COLOR_WHITE" /gotopos [X] [Y] [Z] [Interior ID]");
SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
SetPlayerInterior(playerid, int);
return 1;
}

/////
Reply
#6

@Red_Dragon
4 errors
pawn Код:
D:\samp03\gamemodes\GameFront.pwn(49246) : error 001: expected token: "-string end-", but found "-identifier-"
D:\samp03\gamemodes\GameFront.pwn(49246) : error 017: undefined symbol "chat"
D:\samp03\gamemodes\GameFront.pwn(49246) : warning 215: expression has no effect
D:\samp03\gamemodes\GameFront.pwn(49246) : error 001: expected token: ";", but found ")"
D:\samp03\gamemodes\GameFront.pwn(49246) : fatal error 107: too many error messages on one line
line is
pawn Код:
if(sscanf(params, "u", targetid)) SendClientMessage(playerid,-1,""chat" /gotopos [playerid]");
Reply
#7

WHY Chat? you are checking the ssanf params there so
pawn Код:
""chat" /gotopos [playerid]");
should be

pawn Код:
"/gotopos [playerid]");
You used a double quote and chat...
also

pawn Код:
SendClientMessage(playerid,-1,""chat""COL_GREY" You cannot use this command");
should be

pawn Код:
SendClientMessage(playerid, COL_GREY,"You cannot use this command");//-1 is a random color and after that you use COL_GREY be sure this is defined or you must use code like 0xFFFFFFAA (White)
Reply
#8

pawn Код:
CMD:gotopos(playerid, params[])
{
    new Float:Pos[3], int;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
    if(sscanf(params, "fffi", Pos[0], Pos[1], Pos[2], int)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /gotopos [x] [y] [z] [int]");
    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    SetPlayerInterior(playerid, int);
    return 1;
}
Try that scripts.
Reply
#9

Quote:
Originally Posted by jordy.kiesebrink
Посмотреть сообщение
WHY Chat? you are checking the ssanf params there so
pawn Код:
""chat" /gotopos [playerid]");
should be

pawn Код:
"/gotopos [playerid]");
You used a double quote and chat...
also

pawn Код:
SendClientMessage(playerid,-1,""chat""COL_GREY" You cannot use this command");
should be

pawn Код:
SendClientMessage(playerid, COL_GREY,"You cannot use this command");//-1 is a random color and after that you use COL_GREY be sure this is defined or you must use code like 0xFFFFFFAA (White)
Correction :

-1 is white. not a random color..

and the "COL_GREY" in the message is right, it is wrong if he hasn't got a define like this :

#define COL_GREY {Bla Bla}

"COL_GREY" in the message means "chat" will be white and the other messages will be grey in the command..
Reply
#10

Quote:
Originally Posted by jordy.kiesebrink
Посмотреть сообщение
WHY Chat? you are checking the ssanf params there so
pawn Код:
""chat" /gotopos [playerid]");
should be

pawn Код:
"/gotopos [playerid]");
You used a double quote and chat...
also

pawn Код:
SendClientMessage(playerid,-1,""chat""COL_GREY" You cannot use this command");
should be

pawn Код:
SendClientMessage(playerid, COL_GREY,"You cannot use this command");//-1 is a random color and after that you use COL_GREY be sure this is defined or you must use code like 0xFFFFFFAA (White)
I didn't pay attention for that, sorry and thanks for the corrections and by the way "-1" is white.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)