SA-MP Forums Archive
Mole Help!!!! - 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: Mole Help!!!! (/showthread.php?tid=598718)



Mole Help!!!! - ManIsHere - 16.01.2016

hi Guys i am making new mole CMD but i am facing some Errors-
Quote:

error 017: undefined symbol "cmd"
error 017: undefined symbol "sendername"
error 017: undefined symbol "sendername"
error 029: invalid expression, assumed zero
And here is my CMD-

Quote:

CMD:mole(playerid, params[])
if(strcmp(cmd, "/mole", true) == 0 && PlayerInfo[playerid][pAdmin] >= 5)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /mole [text]");
return 1;
}
format(string, sizeof(string), "SMS: %s, Sender: Server (555)",result);
SendClientMessageToAll(COLOR_YELLOW, string);
}
return 1;
}

Anyone can help me in this?


Re: Mole Help!!!! - GTLS - 16.01.2016

i dont understand why do you make same mistakes again and again mate?
why are you using
PHP код:
 if(strcmp(cmd"/mole"true) == && PlayerInfo[playerid][pAdmin] >= 5
when you are using zcmd and to make simple mole command,
PHP код:
CMD:mole(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 3)
    {
        
SendClientMessage(playeridCOLOR_GREY"You are not authorized to use that command!");
        return 
1;
    }

    new 
string[128];
    if(
isnull(params)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /mole [mole text]");

    
format(stringsizeof(string), "SMS: %s, Sender: Server",params);
    
SendClientMessageToAll(COLOR_YELLOWstring);
    return 
1;

the command you are using is not made for zcmd.. so use that one.


Re: Mole Help!!!! - ManIsHere - 16.01.2016

Thanks @GTLS you always help me Rep++