error 035: argument type mismatch
#1

hello i need help with /radio fs

Код:
ERROR:
(3592) : error 035: argument type mismatch (argument 2)
(3595) : warning 209: function "dcmd_radio" should return a value
pawn Код:
dcmd_radio(playerid,params[])//line 3577
{//line 3578
    if(AccInfo[playerid][Level] >= 500)//line 3579
    for(new i = 0; i < MAX_PLAYERS; i++//line 3580)
    {//line 3581
        if(!strlen(params)) return//line 3582
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /radio [url]") &&//line 3583
        SendClientMessage(playerid, orange, "Function: Will play radio to all player[S]");//line 3584
        new url = strval(params);//line 3585
        new str[128];//line 3586
        GetPlayerName(playerid, str, sizeof(str));//line 3587
        new string[128];//line 3588
        SendCommandToAdmins(playerid,"Radio");//line 3589
        format(string,sizeof(string),"|- Administrator %s Has Streamed Music : %s -|",str,url);//line 3590
        SendClientMessageToAll(yellow,string);//line 3591
        return PlayAudioStreamForPlayer(i,url);//line 3592
    }//line 3593
    else return ErrorMessages(playerid, 1);//line 3594
}//line 3595
Reply
#2

pawn Код:
dcmd_radio(playerid,params[])//line 3577
{//line 3578
    if(AccInfo[playerid][Level] >= 500)//line 3579
    for(new i = 0; i < MAX_PLAYERS; i++//line 3580)
    {//line 3581
        if(!strlen(params)) return//line 3582
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /radio [url]") &&//line 3583
        SendClientMessage(playerid, orange, "Function: Will play radio to all player[S]");//line 3584
        new url = strval(params);//line 3585
        new str[128];//line 3586
        GetPlayerName(playerid, str, sizeof(str));//line 3587
        new string[128];//line 3588
        SendCommandToAdmins(playerid,"Radio");//line 3589
        format(string,sizeof(string),"|- Administrator %s Has Streamed Music : %s -|",str,url);//line 3590
        SendClientMessageToAll(yellow,string);//line 3591
        return PlayAudioStreamForPlayer(i,url);//line 3592
    }//line 3593
    else return ErrorMessages(playerid, 1);//line 3594
    return 1;
}//line 3595
You forget to add return 1; on the end of the cmd.
Reply
#3

that won't even work

new url = strval(params); <= WHY?
URL has to be a STRING
pawn Код:
dcmd_radio(playerid,params[])//line 3577
{//line 3578
    if(AccInfo[playerid][Level] >= 500)//line 3579
    for(new i = 0; i < MAX_PLAYERS; i++//line 3580)
    {//line 3581
        if(!strlen(params)) return//line 3582
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /radio [url]") &&//line 3583
        SendClientMessage(playerid, orange, "Function: Will play radio to all player[S]");//line 3584
        new url[80];
        format(url, 80, "%s", params); //line 3585
        new str[128];//line 3586
        GetPlayerName(playerid, str, sizeof(str));//line 3587
        new string[128];//line 3588
        SendCommandToAdmins(playerid,"Radio");//line 3589
        format(string,sizeof(string),"|- Administrator %s Has Streamed Music : %s -|",str,url);//line 3590
        SendClientMessageToAll(yellow,string);//line 3591
        return PlayAudioStreamForPlayer(i,url);//line 3592
    }//line 3593
    else return ErrorMessages(playerid, 1);//line 3594
}//line 3595
^ try that
Reply
#4

Quote:
Originally Posted by Gangster-rocks
Посмотреть сообщение
pawn Код:
dcmd_radio(playerid,params[])//line 3577
{//line 3578
    if(AccInfo[playerid][Level] >= 500)//line 3579
    for(new i = 0; i < MAX_PLAYERS; i++//line 3580)
    {//line 3581
        if(!strlen(params)) return//line 3582
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /radio [url]") &&//line 3583
        SendClientMessage(playerid, orange, "Function: Will play radio to all player[S]");//line 3584
        new url = strval(params);//line 3585
        new str[128];//line 3586
        GetPlayerName(playerid, str, sizeof(str));//line 3587
        new string[128];//line 3588
        SendCommandToAdmins(playerid,"Radio");//line 3589
        format(string,sizeof(string),"|- Administrator %s Has Streamed Music : %s -|",str,url);//line 3590
        SendClientMessageToAll(yellow,string);//line 3591
        return PlayAudioStreamForPlayer(i,url);//line 3592
    }//line 3593
    else return ErrorMessages(playerid, 1);//line 3594
    return 1;
}//line 3595
You forget to add return 1; on the end of the cmd.
i already put return1;

it is

pawn Код:
else return ErrorMessages(playerid, 1);//line 3594
and after i used you code i got this error

Код:
(3581) : error 001: expected token: ")", but found "{"
(3592) : error 035: argument type mismatch (argument 2)
Reply


Forum Jump:


Users browsing this thread: