Need help with this command
#1

Hey guys I was wondering how I can do this... it'll be easier for me to show the code then explain:

Код:
for(new i = 0; i != MAX_PLAYERS; ++i)
{
    	if(IsPlayerConnected(i))
    	{
    		   if(PlayerInfo[playerid][pSongPlaying] == 1)
    		   {
    		    	Stop*******VideoForPlayer(playerid);
    		    	PlayerInfo[playerid][pSongPlaying] = 0;
                        Play*******VideoForPlayer(i,ylink);
    	   		PlayerInfo[playerid][aSongPlaying] = 1;
    		   }
    	}
}
I wanted to make it so if the player has psongplaying == 1 then it'll stop the ******* video and then do the rest of the function, which just plays the song the admins puts on. However currently it just ends any song that is put on for the player.. unless the whole command doesn't work in which I wouldn't really know what I did wrong. I didn't think there was a need to show everything, so if more code is needed, tell me.

Also, why is this saying unknown command in game even though it's returning 1 in both positions where it needs to?

PHP код:
CMD:playsong(playeridparams[])
{
     if(
PlayerInfo[playerid][aSongPlaying] == 1)
     {
         
SendClientMessage(playerid, -1"An admin song is already playing, therefore you cannot play music!");
     }
     else
     {
         new 
ylink[60];
        if(
sscanf(params,"s[60]",ylink)) return SendClientMessage(playerid, -1"Usage: /playsong [******* URL]");
        
SendClientMessage(playerid, -1"Remember not all links work, if you get Error 6 when you try to play it then you need to find a new song");
        if(
strlen(ylink) > 60) return SendClientMessage(playerid, -1"That link is too long!");
        
Play*******VideoForPlayer(playerid,ylink);
        
PlayerInfo[playerid][pSongPlaying] = 1;
        return 
1;
    }
    return 
1;

Reply
#2

Does anyone have an idea as to what's wrong here?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)