CMD problem -
kaiks - 23.07.2012
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.
Re: CMD problem -
[IKS]Niko_Hs™ - 23.07.2012
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..
Re: CMD problem -
kaiks - 23.07.2012
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
Re: CMD problem -
tyler12 - 23.07.2012
show us the command.
U must include zcmd for zcmd commands.
Re: CMD problem -
kaiks - 23.07.2012
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.");
}
Re: CMD problem -
[IKS]Niko_Hs™ - 23.07.2012
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..
Re: CMD problem -
vassilis - 23.07.2012
Not sure but shouldn't he return a value to the command? (
return 1; return 0; ) ?
Re: CMD problem -
ReneG - 23.07.2012
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;
}