SA-MP Forums Archive
Why this Cmds not working? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Why this Cmds not working? (/showthread.php?tid=543128)



Why this Cmds not working? - MBilal - 24.10.2014

Код:
CMD:gotopos(playerid, params[])
{new Float:xx,Float:yx,Float:zx;
if(Player[playerid][pAdmin] >= 1 || Player[playerid][pLeader] >= 1)
{if(sscanf(params, "fff",xx,yx,zx))
{
SetPlayerPos(playerid,xx,yx,zx);
}
}else return SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Database:]{FFFFFF} You are not a Administrator");
    return 1;
}



Re : Why this Cmds not working? - MCZOFT - 24.10.2014

PHP код:
CMD:gotopos(playeridparams[])
{
new 
Float:xx,Float:yx,Float:zx;
if(
Player[playerid][pAdmin] >= || Player[playerid][pLeader] >= 1)
    {
    if(
sscanf(params"fff",xx,yx,zx))
        {
            
SetPlayerPos(playerid,xx,yx,zx);
        }
    }
    else return 
SendClientMessage(playeridCOLOR_LIGHTGREEN"[Database:]{FFFFFF} You are not a Administrator");
    return 
1;

try this


Re: Why this Cmds not working? - dominik523 - 24.10.2014

Sscanf will return true if you didn't enter command in format /gotopos [x] [y] [z]
Код:
{if(sscanf(params, "fff",xx,yx,zx)) ---> {if(!sscanf(params, "fff",xx,yx,zx))



Re: Why this Cmds not working? - MBilal - 24.10.2014

i Fix it but thanks for Suggestions

CMD:gotopos(playerid, params[])
{new Floatx,Float:yx,Float:zx;
if(Player[playerid][pAdmin] >= 1 || Player[playerid][pLeader] >= 1)
{if(sscanf(params, "fff",xx,yx,zx)) return SendClientMessage(playerid, -1, "[Database]:: /gotopos [X] [Y] [Z]");
{
SetPlayerPos(playerid,xx,yx,zx);
}
}else return SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Database:]{FFFFFF} You are not a Administrator");
return 1;
}

here is Fixed CMD