SA-MP Forums Archive
Having problems converting cmd to ycmd... - 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: Having problems converting cmd to ycmd... (/showthread.php?tid=504197)



Having problems converting cmd to ycmd... - Scrillex - 02.04.2014

Hello dear samp forum members

I have some problem with this cmds...

Here is my commands:
pawn Код:
YCMD:radio(playerid, params[], help)
{
    new string [128];
    new rfreq = PlayerInfo[playerid][pFreq];
    format(string, sizeof(string), "  Your current frequence is <%d>", rfreq);
    SendClientMessage(playerid, 0xFFFFFFAA, string);
    SendClientMessage(playerid, 0xFFFFFFAA, "  Type /freq <radio frequency> to set your radio frequency (numbers only!)");
    SendClientMessage(playerid, 0xFFFFFFAA, "  Use /r <text> to chat");
    return 1;
}
YCMD:freq(playerid, params[], help)
{
    if(sscanf(params, "s[128]", str)) return SendClientMessage(playerid, 0xAFAFAFAA, ".: Usage: /freq [Freqence(100000-999999) :."); //FIRST ERROR.
    freqx = strval(tmp);//SECOND ERROR and 3RD ERROR
    if(freqx > 999999 || freqx < 100000)//4th error
    {
        SendClientMessage(playerid, 0x2641FEAA, "Only frequence between 100000 to 999999 are susported!!");
    }
    else
    {
        PlayerInfo[playerid][pFreq] = freqx;//5TH ERROR
        format(string, 256, "Your radio frequence has been set to %d", freqx);
        SendClientMessage(playerid, 0x2641FEAA, string);//6TH ERROR
    }
    return 1;
}
ERRORS:
pawn Код:
error 017: undefined symbol "str"
error 017: undefined symbol "freqx"
error 017: undefined symbol "tmp"
error 017: undefined symbol "freqx"
error 017: undefined symbol "freqx"
error 017: undefined symbol "string"
error 017: undefined symbol "string"
Thank you for your time and everything.. Just cant clearly understand how that works...


Re: Having problems converting cmd to ycmd... - MBilal - 02.04.2014

PHP код:
YCMD:freq(playeridparams[], help)
{
 new 
string[128],tmp,freqx;
    if(
sscanf(params"s[128]"str)) return SendClientMessage(playerid0xAFAFAFAA".: Usage: /freq [Freqence(100000-999999) :."); //FIRST ERROR.
    
freqx strval(tmp);//SECOND ERROR and 3RD ERROR
    
if(freqx 999999 || freqx 100000)//4th error
    
{
        
SendClientMessage(playerid0x2641FEAA"Only frequence between 100000 to 999999 are susported!!");
    }
    else
    {
        
PlayerInfo[playerid][pFreq] = freqx;//5TH ERROR
        
format(string256"Your radio frequence has been set to %d"freqx);
        
SendClientMessage(playerid0x2641FEAAstring);//6TH ERROR
    
}
    return 
1
try that dude i hope it work


Re: Having problems converting cmd to ycmd... - Scrillex - 02.04.2014

Nop. Still the same prob.. Just took off 3 errors but the same thing.. I know what is the prob on thous two but can't describe it.. Like I know what it is but cant code it.. My mind maybe is to short for that.


Re: Having problems converting cmd to ycmd... - Bingo - 02.04.2014

What errors now you are presisting?


Re: Having problems converting cmd to ycmd... - MBilal - 02.04.2014

dude check the Error in which Lines you got and post it Here + and that Lines also


Re: Having problems converting cmd to ycmd... - Scrillex - 02.04.2014

pawn Код:
if(sscanf(params, "s[128]", str)) return SendClientMessage(playerid, 0xAFAFAFAA, ".: Usage: /freq [Freqence(100000-999999) :."); //FIRST ERROR.  
freqx = strval(tmp);//SECOND ERROR and 3RD ERROR
pawn Код:
: error 017: undefined symbol "str"
: error 035: argument type mismatch (argument 1)
Sorry for delay just I'm slow pow


Re: Having problems converting cmd to ycmd... - MBilal - 02.04.2014

PHP код:
new str[128];
if(
sscanf(params"s[128]"str)) return SendClientMessage(playerid0xAFAFAFAA".: Usage: /freq [Freqence(100000-999999) :."); //FIRST ERROR.  
freqx strval(tmp);//SECOND ERROR and 3RD ERROR 
here u go


Re: Having problems converting cmd to ycmd... - DarkLored - 02.04.2014

try this

pawn Код:
YCMD:freq(playerid, params[], help)
{
    new string[128],str[128];
    if(sscanf(params, "s[128]", str)) return SendClientMessage(playerid, 0xAFAFAFAA, ".: Usage: /freq [Freqence(100000-999999) :."); //FIRST ERROR.
    new freqx = strval(tmp);//SECOND ERROR and 3RD ERROR
    if(freqx > 999999 || freqx < 100000)//4th error
    {
        SendClientMessage(playerid, 0x2641FEAA, "Only frequence between 100000 to 999999 are susported!!");
    }
    else
    {
        PlayerInfo[playerid][pFreq] = freqx;//5TH ERROR
        format(string, 256, "Your radio frequence has been set to %d", freqx);
        SendClientMessage(playerid, 0x2641FEAA, string);//6TH ERROR
    }
    return 1;
}



Re: Having problems converting cmd to ycmd... - Scrillex - 02.04.2014

STR still will be the problem because of that there is no string after it.. I just need to send a message of that the frequency can be set on those waves.


Re: Having problems converting cmd to ycmd... - Bingo - 02.04.2014

Gotcha!

Change and add

Код:
new freqx,string[128];