SA-MP Forums Archive
need help with params - 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: need help with params (/showthread.php?tid=560754)



need help with params - aCloudy - 30.01.2015

Hello.
This MOTD command, shows only the first word, I mean, If i type "/motd Hello guys" it will show only "Hello".
Someone fix it please:

PHP Code:
CMD:motd(playerid,params[])
{
    new 
string[128];
    if(
AdminLevel[playerid] < 4) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}You do not have the correct admin level for this command.");
    
     if(
sscanf(params"string[128]"params)) return SendClientMessage(playerid,COLOR_WHITE""COL_USAGE"[SYNTAX] {FFFFFF}/motd [MESSAGE]");
     
format(string,sizeof(string),"%s",params);
      
TextDrawSetString(MOTDparams);
       
format(string,sizeof(string),"%s(%d) has updated the MOTD",PlayerName(playerid),playerid);
      return 
1;




Re: need help with params - ATGOggy - 30.01.2015

PHP Code:
CMD:motd(playerid,params[]) 

    new 
string[128], message[128]; 
    if(
AdminLevel[playerid] < 4) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}You do not have the correct admin level for this command."); 
     
     if(
sscanf(params"s[128]"message)) return SendClientMessage(playerid,COLOR_WHITE""COL_USAGE"[SYNTAX] {FFFFFF}/motd [MESSAGE]"); 
     
format(string,sizeof(string),"%s",message); 
      
TextDrawSetString(MOTDmessage); 
       
format(string,sizeof(string),"%s(%d) has updated the MOTD",PlayerName(playerid),playerid); 
      return 
1




Re: need help with params - aCloudy - 30.01.2015

Quote:
Originally Posted by Y_Less
View Post
"s", not "string" for sscanf:

https://github.com/Y-Less/sscanf/wiki
Ohh, Okay
And thanks ATGOggy for fixing.