zcmd help needed.
#1

So, i just started doing stuff with zcmd, and i wanted to try a test cmd.
[I had the include set in the folder, and #include at the script]
But, when i try to compile, i get this ->
test.pwn(870) : error 029: invalid expression, assumed zero
test.pwn(870) : error 017: undefined symbol "cmd_test"
test.pwn(870) : error 029: invalid expression, assumed zero
test.pwn(870) : fatal error 107: too many error messages on one line
Script:

COMMAND:test(playerid, params[]) [Line 870]
{
SendClientMessage(playerid, COLOR_PINK, "TEST");
return 1;
}
return 0;
}
(NOTE: Rest of the scripts are in the (strcmp) format!)
Reply
#2

From the errors, I believe that the COMMAND:test is inside a callback (assuming in OnPlayerCommandText).

You need to use it OUT of any callback and do not use both. Switch everything to ZCMD otherwise, you'll get the Unknown command in some of the commands.
Reply
#3

You opened 1 bracket and then closed 2.. and you don't need return 0;, look:

pawn Код:
CMD:test(playerid, params[])
{
    SendClientMessage(playerid, COLOR_PINK, "TEST");
    return 1;
}
Also, do what Konstantinos said too.
Reply
#4

Now the compiler crashes when i try to compile it xd
[Removed the OnPlayerCommandText, replaced strcmp with zcmd, but crashes D:]
Reply
#5

Did you make sure you put the command to the bottom of the script? That's the easiest way to make sure it's not in a callback. Else, you've missed a bracket somewhere else, [ { ( or ) } ].
Reply
#6

Would you mind to show us where do you use the command test? Few lines before and few lines after the command?

You probably did not close the bracket and that's why.
Reply
#7

Moved it to bottom - Still didn't work.
@Konstantinos
Even if i remove it, it gave me the error [It gives me the error if i move it out from the callback or w.e you call it]
Full script(zcmd, not in any callback, is at the bottom now):
http://pastebin.com/7MTNPLKh
Reply
#8

pawn Код:
COMMAND:money(playerid, params[])
    if (!IsPlayerInAnyVehicle(playerid)) return 1;
    new vehicleid = GetPlayerVehicleID(playerid);
    AddVehicleComponent(vehicleid, 1010); // X10 nitro
    SendClientMessage(playerid, 0xFFFFFFFF, "Nitrous added, 10'000$ have been taken!");
    GivePlayerMoney(playerid, -10000);
    return 1;
}
You missed the open bracket here, under COMMAND:money(playerid, params[])

Correct:

pawn Код:
COMMAND:money(playerid, params[])
{
    if (!IsPlayerInAnyVehicle(playerid)) return 1;
    new vehicleid = GetPlayerVehicleID(playerid);
    AddVehicleComponent(vehicleid, 1010); // X10 nitro
    SendClientMessage(playerid, 0xFFFFFFFF, "Nitrous added, 10'000$ have been taken!");
    GivePlayerMoney(playerid, -10000);
    return 1;
}
Reply
#9

ew, something must have went wrong while i replaced it..
Well, the command needed to be 'nitro'
Well, thanks, +rep for both of you c:
By the way, could you help me make the animation/specialactions work?:c
DrunkLevel / JETPACK Special Action doesn't work D:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)