Having problems converting cmd to ycmd...
#1

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...
Reply
#2

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
Reply
#3

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.
Reply
#4

What errors now you are presisting?
Reply
#5

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

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
Reply
#7

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
Reply
#8

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;
}
Reply
#9

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.
Reply
#10

Gotcha!

Change and add

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


Forum Jump:


Users browsing this thread: 2 Guest(s)