SA-MP Forums Archive
Command 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Command problem (/showthread.php?tid=263535)



Command problem - motherfucker - 22.06.2011

Why this command does not work?:
PHP код:
dcmd_Server(playeridparams[]) {
if(
PlayerInfo[playerid][AdminLvl] < 20) return 0;
if(!
PlayerInfo[playerid][AdminLogged])return SendClientMessage(playerid,COLOR_RED,".айрк озебш магойп");
if(!
strlen(params))
return 
SendClientMessage(playerid,COLOR_RED,"Usage: /Server <Gmx/Exit/LoadFs/Unloadfs/Lock/Open>");
if(!
strcmp(params"LoadFs"true))
{
new 
fs[64];
if(
sscanf(params"s"fs)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /Server LoadFs <FS Name>");
new 
string[128];
format(string,128,"loadfs %s",fs);
SendRconCommand(string);
format(string,128,"Try to load FS: %s.amx... Loaded!",fs);
return 
SendClientMessage(playerid,COLOR_GREEN,string);
}
return 
true;




Re: Command problem - Basicz - 22.06.2011

Which problem do you get, please use [ pawn ] tag too.

But...
Replace
pawn Код:
if ( !strcmp( params, "LoadFs", true ) ) // Idk, this should works though.
if ( sscanf( params, "s", fs ) )
With
pawn Код:
if ( !strcmp( params, "LoadFs", true, 6 ) )
if ( sscanf( params, "s[ 64 ]", fs ) )
Please, add more information, what is the error.


Re: Command problem - motherfucker - 22.06.2011

The problem is this line:
if(!sscanf(params,"s[64]",fs)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /Server LoadFs <FS Name>");

When I use this command this send It sends me this message Usage: /Server LoadFs <FS Name>


Re: Command problem - motherfucker - 23.06.2011

Someone?


Re: Command problem - =WoR=Varth - 23.06.2011

pawn Код:
if(sscanf(params,"s[64]",fs)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /Server LoadFs <FS Name>");