[HELP]need CMD help
#1

when i have a CMD made with x y and z stuff,
and i do: example: 111.111 222.222 333.333
he only do: 111 222 333 and not 111.111 222.222 333.333
so he don't get the stuff after the points
how to change that he gets it after the points to?
Reply
#2

Use floatstr(string); not strval(string);
Reply
#3

then it says:
Код:
C:\Documents and Settings\Administrator\Bureaublad\RealLife RPG Server\gamemodes\frpg.pwn(9665) : warning 213: tag mismatch
C:\Documents and Settings\Administrator\Bureaublad\RealLife RPG Server\gamemodes\frpg.pwn(9667) : warning 213: tag mismatch
C:\Documents and Settings\Administrator\Bureaublad\RealLife RPG Server\gamemodes\frpg.pwn(9668) : warning 213: tag mismatch
C:\Documents and Settings\Administrator\Bureaublad\RealLife RPG Server\gamemodes\frpg.pwn(9669) : warning 213: tag mismatch
C:\Documents and Settings\Administrator\Bureaublad\RealLife RPG Server\gamemodes\frpg.pwn(9670) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
the CMD is:
pawn Код:
if(strcmp(cmd, "/edithinterior", true) == 0)
    {
      tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /edithinterior [houseid] [interiorX] [interiorY] [interiorZ] [UniversalID]");
            return 1;
        }
        giveplayerid = floatstr(tmp);
        tmp = strtok(cmdtext, idx);
        new a1 = floatstr(tmp);
        new b2 = floatstr(tmp);
        new c3 = floatstr(tmp);
        new world = floatstr(tmp);

        if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 105)
        {
            for(new i=0; i<MAX_HOUSES; i++)
            {
                HouseInfo[i][hExitx] = a1;
                HouseInfo[i][hExity] = b2;
                HouseInfo[i][hExitz] = c3;
                HouseInfo[i][hWorld] = world;
                format(string, sizeof(string), "-OperServ- Houseid %d it's interior has been set to %d, %d world %d and %d by admin %s", giveplayerid, a1, b2, c3, world, PlayerName[playerid]);
                SendClientMessageToAll(COLOR_LIGHTBLUE, string);
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use this command.");
        }
        return 1;
    }
Reply
#4

Try this command (you need to have zcmd include + sscanf)
pawn Код:
command(edithinterior,playerid,params[])
{
    new houseid, Float:hX, Float: hY, Float: hZ, intID;

    if(sscanf(params,"ifffi",houseid,hX,hY,hZ,intID)) return
                SendClientMessage(playerid,COLOR_GREY,"USAGE: /edithinterior [houseid] [hX] [hY] [hZ] [interior ID]");

    else
    {
      if(IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 105)
      {
            HouseInfo[houseid][hExitx] = hX;
            HouseInfo[houseid][hExity] = hY;
            HouseInfo[houseid][hExitz] = hZ;
            HouseInfo[houseid][hWorld] = intID;
            format(string,sizeof(string), "-OperServ- Houseid's %d interior has been set to %d (%f,%f,%f)",houseid,intID,hX,hY,hZ);
            SendClientMessageToAll(COLOR_LIGHTBLUE,string);
        }
        else SendClientMessage(playerid,COLOR_GREY,"You're not allowed to use this command!");
    }
    return 1;
}
Reply
#5

can you make it whitout?
Reply
#6

Код:
giveplayerid = strval(tmp);
tmp = strtok(cmdtext, idx);
new Float:a1 = floatstr(tmp);
tmp = strtok(cmdtext, idx);
new Float:b2 = floatstr(tmp);
tmp = strtok(cmdtext, idx);
new Float:c3 = floatstr(tmp);
tmp = strtok(cmdtext, idx);
new world = strval(tmp);
and
Код:
format(string, sizeof(string), "-OperServ- Houseid %d it's interior has been set to %f, %f world %f and %d by admin %s", giveplayerid, a1, b2, c3, world, PlayerName[playerid]);
Reply
#7

somebody already made it with dcmd,
but thanks for helping!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)