error 035
#1

I tried to make radio in range, but failed..
PHP код:
./includes/commands.pwn(7087) : error 035argument type mismatch (argument 1)
./
includes/callbacks.pwn(5132) : error 035argument type mismatch (argument 1)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
2 Errors

Code
PHP код:
CMD:xe(playeridparams[])
{
    new 
string[128];
    if(
isnull(params))
    {
        
SendClientMessageEx(playeridCOLOR_GREY"SUDUNG: /xe [name]");
        
SendClientMessageEx(playeridCOLOR_GREY"Available names: Status, Khoidong, Denxe, Cop, Mui, Fuel, Windows");
        return 
1;
    }
    if(
strcmp(params"khoidong"true) == && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new 
engine,lights,alarm,doors,bonnet,boot,objective,vehicleid;
        
vehicleid GetPlayerVehicleID(playerid);
        if(
GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510 || DynVeh[vehicleid] != -&& DynVehicleInfo[DynVeh[vehicleid]][gv_iType] == && GetVehicleModel(vehicleid) == 592) return SendClientMessageEx(playerid,COLOR_WHITE,"Lenh nay khong the su dung trong chiec xe nay.");
        
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(
engine == VEHICLE_PARAMS_ON)
        {
            
SetVehicleEngine(vehicleidplayerid);
            
format(stringsizeof(string), "{FF8000}** {C2A2DA}%s rut chia khoa ra, va dong co da tat."GetPlayerNameEx(playerid));
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
        else if((
engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
        {
            if (
GetPVarInt(playerid"Refueling")) return SendClientMessageEx(playeridCOLOR_WHITE"Ban khong the lam dieu nay khi ban dang bo xang.");
            
format(stringsizeof(string), "{FF8000}** {C2A2DA}%s dut chia khoa vao, va dong co da mo."GetPlayerNameEx(playerid));
            
GameTextForPlayer(playerid"~y~Dong Co xe~n~~w~Da bat"20001);
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
SendClientMessageEx(playeridCOLOR_WHITE"Dong co cua xe dang duoc mo, vui long cho...");
            new 
Float:XFloat:YFloat:ZFloat:Distance 50.0;
            
GetPlayerPos(playeridXYZ);
             
SendAudioURLToRange(playeridXYZDistance1); //this line
            
PlayAudioStreamForPlayerEx(playerid"http://www.pr-rp.com/gameserver/sounds/vehstart.mp3"XZYDistance0);
            
SetTimerEx("SetVehicleEngine"40000"dd",  vehicleidplayerid);
        } 
Reply
#2

Hello!

The errors are in the includes:
PHP код:
./includes/commands.pwn(7087)
./
includes/callbacks.pwn(5132
Show us the code of the rows.

Mencent
Reply
#3

here is it
Quote:

line 7087 : SendAudioURLToRange(X, Y, Z, Distance, 1);
Line 5132: SendAudioURLToRange(X, Y, Z, Distance, 1);

Reply
#4

Could you send us the function?

Mencent
Reply
#5

Here is it
Quote:

stock SendAudioURLToRange(url[], Float, Float:y, Float:z, Float:range)
{
audiourlid = CreateDynamicSphere(x, y, z, range);
format(audiourlurl, sizeof(audiourlurl), "%s", url);
audiourlparams[0] = x;
audiourlparams[1] = y;
audiourlparams[2] = z;
audiourlparams[3] = range;
return 1;
}

Reply
#6

edit :
SendAudioURLToRange("http://www.pr-rp.com/gameserver/sounds/vehstart.mp3", X, Y, Z, 1)

please change "http://www.pr-rp.com/gameserver/sounds/vehstart.mp3" to your audio url
Reply
#7

Now i have this error
./includes/commands.pwn(7089) : error 001: expected token: ";", but found "-identifier-"
./includes/commands.pwn(7085) : warning 204: symbol is assigned a value that is never used: "Distance"
./includes/callbacks.pwn(5134) : error 001: expected token: ";", but found "-identifier-"
./includes/callbacks.pwn(5130) : warning 204: symbol is assigned a value that is never used: "Distance"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#8

Write it so:
PHP код:
stock SendAudioURLToRange(url[], Float:xFloat:yFloat:zFloat:range)
{
    
audiourlid CreateDynamicSphere(xyzrange);
    
strcat(audiourlurl,url);
    
audiourlparams[0] = x;
    
audiourlparams[1] = y;
    
audiourlparams[2] = z;
    
audiourlparams[3] = range;
    return 
1;
}
else if((
engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
{
    if(
GetPVarInt(playerid,"Refueling"))return SendClientMessage(playerid,COLOR_WHITE,"Ban khong the lam dieu nay khi ban dang bo xang.");
    
format(string,sizeof string,"{FF8000}**{C2A2DA} %s dut chia khoa vao, va dong co da mo.",GetPlayerNameEx(playerid));
    
GameTextForPlayer(playerid,"~y~Dong Co xe~n~~w~Da bat",2000,1);
    
ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    
SendClientMessageEx(playerid,COLOR_WHITE,"Dong co cua xe dang duoc mo, vui long cho...");
    new 
Float:pPos[3],Float:Distance 50.0;
    
GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
    
SendAudioURLToRange("http://www.pr-rp.com/gameserver/sounds/vehstart.mp3",pPos[0],pPos[1],pPos[2],Distance);
    
PlayerAudioStreamForPlayerEx(playerid,"http://www.pr-rp.com/gameserver/sounds/vehstart.mp3",pPos[0],pPos[1],pPos[2],Distance,0);
    
SetTimerEx("SetVehicleEngine",4000,0,"dd",vehicleid,playerid);

Mencent
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)