CMD problem
#1

I have this cmd at the bottom of my GM:
pawn Код:
CMD:saveonfoot(playerid, params[])
And it gives me a warning and doesn't work in-<a class="inlineAdmedialink" href="#">game</a>:
Код:
warning 203: symbol is never used: "saveonfoot"
I have included sscanf2, help.
Reply
#2

Did you #include <zcmd> ? Also, use lower-case.

The command must be done this way :

Код:
CMD:saveonfoot(playerid, params[]) {
//Functions
return 1;
}
Post the command, so we can help..
Reply
#3

I knew it was from the zcmd, but in my other GM, the zcmd isn't included and it works like a charm.
But if i include zcmd in this GM, it crashes the compiler
Reply
#4

show us the command.
U must include zcmd for zcmd commands.
Reply
#5

Okay, here's the command.
pawn Код:
CMD:saveonfoot(playerid, params[])
{
    if(gPlayerLoggedIn[playerid] == 0) return 1;

    if(KasutajaInfo[playerid][kAdmin] < 3) {
        SendClientMessage(playerid, COLOR_LIGHTRED, "CMD: You are not authorized to use this command, I am sorry.");
        return 1;
    }

    if(!isnull(params)) {
        new string[256];
        new File:onfoot=fopen("onfootpositions.txt", io_append);
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        new Float:A;
        GetPlayerFacingAngle(playerid, A);
        format(string, sizeof(string), "SetPlayerPos(playerid, %f, %f, %f); \r\nSetPlayerFacingAngle(playerid, %f);// %s \r\n\r\n\r\n", X, Y, Z, A, params);
        fwrite(onfoot, string);
        fclose(onfoot);
        SendClientMessage(playerid, COLOR_LIGHTRED, "* You have saved your on foot position.");
        return 1;
    }
    else return SendClientMessage(playerid, COLOR_GREY, "* Must add a comment.");
}
Reply
#6

it is impossible that "zcmd # include" functions without having been included , surely you have an include that included zcmd..

Try downloading zcmd, and compile again..
Reply
#7

Not sure but shouldn't he return a value to the command? (return 1; return 0; ) ?
Reply
#8

pawn Код:
CMD:saveonfoot(playerid, params[])
{
    if(gPlayerLoggedIn[playerid] == 0) return 1;

    if(KasutajaInfo[playerid][kAdmin] < 3) {
        SendClientMessage(playerid, COLOR_LIGHTRED, "CMD: You are not authorized to use this command, I am sorry.");
        return 1;
    }

    if(!isnull(params)) {
        new string[256];
        new File:onfoot=fopen("onfootpositions.txt", io_append);
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        new Float:A;
        GetPlayerFacingAngle(playerid, A);
        format(string, sizeof(string), "SetPlayerPos(playerid, %f, %f, %f); \r\nSetPlayerFacingAngle(playerid, %f);// %s \r\n\r\n\r\n", X, Y, Z, A, params);
        fwrite(onfoot, string);
        fclose(onfoot);
        SendClientMessage(playerid, COLOR_LIGHTRED, "* You have saved your on foot position.");
        return 1;
    }
    else {SendClientMessage(playerid, COLOR_GREY, "* Must add a comment.");}
   
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)