commands in the console?! - 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: commands in the console?! (
/showthread.php?tid=439923)
commands in the console?! -
NicholasA - 27.05.2013
Код:
public OnRconCommand(cmd[])
{
if(!strcmp(cmd,"help",true))
{
clearconsole();
print("Welcome to the admin control panel of guards vs the assassin!");
print("The server is can be fully controlled in this window!");
print("Your commands are the following:");
print("clearconsole, ");
return 1;
}
else if(!strcmp(cmd,"clearconsole",true))
{
clearconsole();
return 1;
}
return 0;
}
When i type "help" nothing happens same thing for "clearconsole"
AW: commands in the console?! -
Blackazur - 27.05.2013
try that
Код:
public OnRconCommand(cmd[])
{
if(strcmp(cmd,"help",true))
{
clearconsole();
print("Welcome to the admin control panel of guards vs the assassin!");
print("The server is can be fully controlled in this window!");
print("Your commands are the following:");
print("clearconsole, ");
return 1;
}
else if(!strcmp(cmd,"clearconsole",true))
{
clearconsole();
return 1;
}
return 0;
}
Re: commands in the console?! -
Hernando - 27.05.2013
Don't use that as it will clear it if you do /help, and it doesn't actually register the /clearconsole CMD, try this:
pawn Код:
public OnRconCommand(cmd[])
{
if(!strcmp(cmd,"help",true))
{
print("Welcome to the admin control panel of guards vs the assassin!");
print("The server is can be fully controlled in this window!");
print("Your commands are the following:");
SendRconCommand("clearconsole");
return 1;
}
if(!strcmp(cmd,"clearconsole",true))
{
clearconsole();
return 1;
}
return 0;
}
Re: commands in the console?! -
Scenario - 27.05.2013
https://sampwiki.blast.hk/wiki/OnRconCommand
Strcmp returns 0 if the strings are the same, so that code won't work Blackazur.
Re: commands in the console?! -
Hernando - 27.05.2013
@RealCop228
1: Sorry for getting mad about your posts, that was very childish of me. I shouldn't have asked for that from you guys.
2: In the code I gave him it's if(!strcmp(cmd, "CMD", true)) as I know it returns 0 if they are the same.
Re: commands in the console?! -
NicholasA - 28.05.2013
Still doesnt work guys
please help