25.11.2012, 00:16
Here is my error, What is wrong?
Here is the code:
if(IsPlayerInRangeOfPoint(playerid,20,-2105.9446,2698.6633,161.1431); // or you can use If(IsPlayerInRangeOfPoint(playerid,range,X,Y,Z)
{
if(!GetPVarInt(playerid,"knull")) // we are looking if there as variable with the name 'spawn' present , which we havent created yet
{
SetPVarInt(playerid,"knull",1); // since there wasnt , we now create it so that the loop doesnt enter this again n again and create 'lag'
PlayAudioStreamForPlayer(playerid,"http://www.youtube.com/watch?v=oMOxoQm4iJ0",-2105.9446,2698.6633,161.1431,20,1);
}
}
else // player is not in point range
{
if(GetPVarInt(playerid,"knull")) // since we create it before and played the stream , it will be there
{
DeletePVar(playerid,"knull");// delete the variable so that next time player goes in range the radio can be started again
StopAudioStreamForPlayer(playerid); and stop stream
}
}
return 1;
}
Код:
C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(13804) : error 010: invalid function or declaration C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(13806) : error 010: invalid function or declaration C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(13812) : error 010: invalid function or declaration C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(13814) : error 010: invalid function or declaration C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(13821) : error 010: invalid function or declaration
if(IsPlayerInRangeOfPoint(playerid,20,-2105.9446,2698.6633,161.1431); // or you can use If(IsPlayerInRangeOfPoint(playerid,range,X,Y,Z)
{
if(!GetPVarInt(playerid,"knull")) // we are looking if there as variable with the name 'spawn' present , which we havent created yet
{
SetPVarInt(playerid,"knull",1); // since there wasnt , we now create it so that the loop doesnt enter this again n again and create 'lag'
PlayAudioStreamForPlayer(playerid,"http://www.youtube.com/watch?v=oMOxoQm4iJ0",-2105.9446,2698.6633,161.1431,20,1);
}
}
else // player is not in point range
{
if(GetPVarInt(playerid,"knull")) // since we create it before and played the stream , it will be there
{
DeletePVar(playerid,"knull");// delete the variable so that next time player goes in range the radio can be started again
StopAudioStreamForPlayer(playerid); and stop stream
}
}
return 1;
}