SA-MP Forums Archive
zCMD problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: zCMD problem (/showthread.php?tid=632645)



zCMD problem - a1m[z0r] - 17.04.2017

Hello guys, i have this command between the others:

pawn Код:
CMD:o(playerid, params[])
{
    new string[128];
    if((noooc) && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD2, "The OOC channel has been disabled by an Admin !");
    if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, TEAM_CYAN_COLOR, "You can't speak, you have been silenced !");
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(isnull(params)) return SendClientMessage(playerid, COLOR_CMD, "USAGE: (/o)oc [text]");
    format(string, sizeof(string), "(( %s: %s ))", sendername, result);
    OOCOff(COLOR_OOC,string);
    printf("%s", string);
    return CMD_ooc(playerid, params);
}
and i get this error:

pawn Код:
error 017: undefined symbol "CMD_ooc"
and the line is this:

pawn Код:
return CMD_ooc(playerid, params);
Whats the problem over here? i've made it like in tutorials..


Re: zCMD problem - Zav1337 - 17.04.2017

Try changing "CMD_ooc" to "cmd_ooc".


Re: zCMD problem - a1m[z0r] - 17.04.2017

Quote:
Originally Posted by Zav1337
Посмотреть сообщение
Try changing "CMD_ooc" to "cmd_ooc".
Same error.


Re: zCMD problem - Younes44 - 17.04.2017

there's no such CMD_ooc in your gamemode
try to search in your gamemode for cmdoc ?
and return 1;


Re: zCMD problem - Astralis - 17.04.2017

If you wanna make multiple commands be the same just do;
pawn Код:
CMD:oc(playerid,params[]) return cmd_ooc(playerid,params[]);

CMD:o(playerid, params[])
{
    new string[128];
    if((noooc) && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD2, "The OOC channel has been disabled by an Admin !");
    if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, TEAM_CYAN_COLOR, "You can't speak, you have been silenced !");
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(isnull(params)) return SendClientMessage(playerid, COLOR_CMD, "USAGE: (/o)oc [text]");
    format(string, sizeof(string), "(( %s: %s ))", sendername, result);
    OOCOff(COLOR_OOC,string);
    printf("%s", string);
    return 1;
}



Re: zCMD problem - a1m[z0r] - 17.04.2017

Quote:
Originally Posted by Astralis
Посмотреть сообщение
If you wanna make multiple commands be the same just do;
pawn Код:
CMD:oc(playerid,params[]) return cmd_ooc(playerid,params[]);

CMD:o(playerid, params[])
{
    new string[128];
    if((noooc) && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD2, "The OOC channel has been disabled by an Admin !");
    if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, TEAM_CYAN_COLOR, "You can't speak, you have been silenced !");
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(isnull(params)) return SendClientMessage(playerid, COLOR_CMD, "USAGE: (/o)oc [text]");
    format(string, sizeof(string), "(( %s: %s ))", sendername, result);
    OOCOff(COLOR_OOC,string);
    printf("%s", string);
    return 1;
}
I did:
pawn Код:
CMD:o(playerid,params[]) return cmd_ooc(playerid,params[]);
And works, is not like in tutorial btw, thanks!


On my next command:
pawn Код:
CMD:ad(playerid, params[])
{
    new payout = idx * 25;
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(sscanf(params, "s[64]", result)) return SendClientMessage(playerid, COLOR_CMD, "USAGE: (/ad)vertise [text]");
    if((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
    {
        format(string, sizeof(string), "Please try again later %d seconds between Advertisements !",  (addtimer/1000));
        SendClientMessage(playerid, COLOR_GRAD2, string);
        return 1;
    }
    GivePlayerMoney(playerid, - payout);
    SBizzInfo[7][sbTill] += payout;
    format(string, sizeof(string), "Advertisement: %s, Contact: %s Ph: %d",  result, sendername,PlayerInfo[playerid][pPnumber]);
    OOCNews(TEAM_GROVE_COLOR,string);
    format(string, sizeof(string), "~r~Paid %s~n~~w~Message contained: %d Characters", FormatMoney(payout), idx);
    GameTextForPlayer(playerid, string, 5000, 5);
    if(PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
    return CMD_advertise(playerid, params);
}
Works fine but i dont understand what is the problem at /ooc command.


Re: zCMD problem - Astralis - 17.04.2017

pawn Код:
CMD:advertise(playerid,params[]) return cmd_ad(playerid,params[]);



CMD:ad(playerid, params[])
{
    new payout = idx * 25;
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(sscanf(params, "s[64]", result)) return SendClientMessage(playerid, COLOR_CMD, "USAGE: (/ad)vertise [text]");
    if((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
    {
        format(string, sizeof(string), "Please try again later %d seconds between Advertisements !",  (addtimer/1000));
        SendClientMessage(playerid, COLOR_GRAD2, string);
        return 1;
    }
    GivePlayerMoney(playerid, - payout);
    SBizzInfo[7][sbTill] += payout;
    format(string, sizeof(string), "Advertisement: %s, Contact: %s Ph: %d",  result, sendername,PlayerInfo[playerid][pPnumber]);
    OOCNews(TEAM_GROVE_COLOR,string);
    format(string, sizeof(string), "~r~Paid %s~n~~w~Message contained: %d Characters", FormatMoney(payout), idx);
    GameTextForPlayer(playerid, string, 5000, 5);
    if(PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
    return 1;
}
For example you have CMD:rules in your script, and you want to make /rul and /ru and /rule to open the /rules command.

So you do:

pawn Код:
CMD:ru(playerid,params[]) return cmd_rules(playerid,params[]);
CMD:rul(playerid,params[]) return cmd_rules(playerid,params[]);
CMD:rule(playerid,params[]) return cmd_rules(playerid,params[]);
Before the command cmd:rules.


Re: zCMD problem - Jessyy - 17.04.2017

Here is an example of what are you trying to do, compare your code with what you find here.
https://github.com/Open-GTO/Open-GTO...d_spectate.pwn


Re: zCMD problem - a1m[z0r] - 17.04.2017

Quote:
Originally Posted by Jessyy
Посмотреть сообщение
Here is an example of what are you trying to do, compare your code with what you find here.
https://github.com/Open-GTO/Open-GTO...d_spectate.pwn
Its ok, i solved it.