undefined symbol
#1

Hello! I have a big problem, I changed the command to strcmp, and is showing errors .. what I did wrong ..

Код:
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(48231) : error 017: undefined symbol "params"
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(48224) : warning 204: symbol is assigned a value that is never used: "Msg"
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(48234) : warning 204: symbol is assigned a value that is never used: "PickID"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
PHP код:
    if (strcmp(cmd"/criarpickup"true) == 0)
    {
        new 
PickupModeloPickIDMsg[128], FloatxFloatyFloatzPickupTipo;
        for (new 
iMAX_PLAYERSi++)
        {
            if (
IsPlayerConnected(i))
            {
                if (
PlayerInfo[playerid][pAdmin] == 3000)
                {
                    if (
sscanf(params"ifffi"PickupModeloxyzPickupTipo)) SendClientMessage(playerid0xFF0000AA"Digite: \"/criarpick <PickupModelo> <x> <y> <z> <PickupTipo>\"");
                    else
                    {
                        
PickID CreatePickup(PickupModeloPickupTipoxyz, -1);
                    }
                }
                else return 
0;
            }
            else return 
0;
        }
        return 
1;
    } 
Reply
#2

Use zcmd better: https://sampforum.blast.hk/showthread.php?tid=91354
Код:
CMD:criarpickup(playerid, params[])
{       
        new PickupModelo, PickID, Msg[128], Float: x, Float: y, Float: z, PickupTipo; 
        for (new i; i < MAX_PLAYERS; i++) 
        { 
            if (IsPlayerConnected(i)) 
            { 
                if (PlayerInfo[playerid][pAdmin] == 3000) 
                { 
                    if (sscanf(params, "ifffi", PickupModelo, x, y, z, PickupTipo)) SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/criarpick <PickupModelo> <x> <y> <z> <PickupTipo>\""); 
                    else 
                    { 
                        PickID = CreatePickup(PickupModelo, PickupTipo, x, y, z, -1); 
                    } 
                } 
                else return 0; 
            } 
            else return 0; 
        } 
        return 1; 
}
Reply
#3

Test This.


Код:
if (strcmp(cmd, "/criarpickup", true) == 0) 
    { 
        new PickupModelo, Float: x, Float: y, Float: z, PickupTipo, params; 
        for (new i; i < MAX_PLAYERS; i++) 
        { 
            if (IsPlayerConnected(i)) 
            { 
                if (PlayerInfo[playerid][pAdmin] == 3000) 
                { 
                    if (sscanf(params, "ifffi", PickupModelo, x, y, z, PickupTipo)) SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/criarpick <PickupModelo> <x> <y> <z> <PickupTipo>\""); 
                    else 
                    { 
                        PickID = CreatePickup(PickupModelo, PickupTipo, x, y, z, -1); 
                    } 
                } 
                else return 0; 
            } 
            else return 0; 
        } 
        return 1; 
    }
Reply
#4

Where would params be?
Reply
#5

Quote:
Originally Posted by AlonzoTorres
Посмотреть сообщение
Where would params be?
has params ..
Reply
#6

Quote:
Originally Posted by AlonzoTorres
Посмотреть сообщение
Where would params be?
Params error is caused due to this line
Код:
 if (sscanf(params, "ifffi", PickupModelo, x, y, z, PickupTipo)) SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/criarpick <PickupModelo> <x> <y> <z> <PickupTipo>\"");
I tried it with ZCMD i didn't get the error just the warnings.
Reply
#7

Correct?

PHP код:
    if (strcmp(cmd"/criarpickup"true) == 0)
    {
        new 
modelFloatxFloatyFloatz;
        for (new 
iMAX_PLAYERSi++)
        {
                if (
PlayerInfo[playerid][pAdmin] >= 1)
                {
                    
model cmdtext;
                    
tmp strtok(cmdtextidx);
                    if (!
strlen(tmp)) SendClientMessage(playerid, -1"USE: /criarpickup [model]");
                    else
                    {
                        
GetPlayerPos(playeridxyz);
                        
CreatePickup(model1xyz, -1);
                    }
                }
                else return 
0;
        }
        return 
1;
    } 
#edit
It is showing errors, and it is not functional ..
Reply
#8

Why using these while there are better and easier ways to make command. Use sscanf and zcmd.
Reply
#9

up
Reply
#10

Dude get sscanf and zcmd and put this it will work.
Код:
CMD:criarpickup(playerid, params[])
{
        new PickupModelo, Float: x, Float: y, Float: z, PickupTipo;
        for (new i; i < MAX_PLAYERS; i++)
        {
            if (IsPlayerConnected(i))
            {
                if (PlayerInfo[playerid][pAdmin] == 3000)
                {
                    if (sscanf(params, "ifffi", PickupModelo, x, y, z, PickupTipo)) SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/criarpick <PickupModelo> <x> <y> <z> <PickupTipo>\"");
                    else
                    {
                       CreatePickup(PickupModelo, PickupTipo, x, y, z, -1);
                    }
                }
                else return 0;
            }
            else return 0;
        }
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)