warning 239: literal array/string passed to a non-const parameter
#1

Hello, I got lots of warnings when I use this function:
PHP код:
stock PlayAudioStreamForPlayersInCar(vehicleidurl[])
{
    foreach(new 
Player)
    {
        if(
IsPlayerInAnyVehicle(i))
        {
            if(
GetPlayerVehicleID(i) == vehicleid)
            {
                
PlayAudioStreamForPlayer(i,url);
            }
        }
    }
    return 
1;
}
PlayAudioStreamForPlayersInCar(vehicleid"http://RadioURL.domain");// warning 239: literal array/string passed to a non-const parameter 
How can I solve these warnings?
Thank you in advance!
Reply
#2

PHP код:
stock PlayAudioStreamForPlayersInCar(vehicleid, const url[]) 
Reply
#3

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
PHP код:
stock PlayAudioStreamForPlayersInCar(vehicleid, const url[]) 
I tried but I got error on PlayAudioStreamForPlayer(i,url); // error 035: argument type mismatch (argument 2)
Reply
#4

Quote:
Originally Posted by StRaphael
Посмотреть сообщение
I tried but I got error on PlayAudioStreamForPlayer(i,url); // error 035: argument type mismatch (argument 2)
Open your includes folder, find a_players.inc and look for

PHP код:
native PlayAudioStreamForPlayer(playeridurl[], Float:posX 0.0Float:posY 0.0Float:posZ 0.0Float:distance 50.0usepos 0); 
edit it to

PHP код:
native PlayAudioStreamForPlayer(playerid, const url[], Float:posX 0.0Float:posY 0.0Float:posZ 0.0Float:distance 50.0usepos 0); 
Reply
#5

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
Open your includes folder, find a_players.inc and look for

PHP код:
native PlayAudioStreamForPlayer(playeridurl[], Float:posX 0.0Float:posY 0.0Float:posZ 0.0Float:distance 50.0usepos 0); 
edit it to

PHP код:
native PlayAudioStreamForPlayer(playerid, const url[], Float:posX 0.0Float:posY 0.0Float:posZ 0.0Float:distance 50.0usepos 0); 
Thank you, it worked!
+rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)