Why this Cmds not working?
#1

Код:
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;
}
Reply
#2

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
Reply
#3

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))
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)