#include <zcmd>
#define COLOR_GREEN 0x00FF00FF
CMD:burn(playerid, params[])
{
for(new i=0; i<MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i,"http://dl.farskids405.com/Aria/92/4/15/Ellie%20Goulding%20-%20Burn%20[128].mp3");
SendClientMessageToAll(COLOR_GREEN,"Track playing-Ellie Goulding - Burn");
}
return 1;
}
CMD:burn(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return 0;
for(new i=0; i<MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i,"http://dl.farskids405.com/Aria/92/4/15/Ellie%20Goulding%20-%20Burn%20[128].mp3");
SendClientMessageToAll(COLOR_GREEN,"Track playing-Ellie Goulding - Burn");
}
return 1;
}
C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(62) : warning 235: public function lacks forward declaration (symbol "OnGameModeInit") C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(64) : error 017: undefined symbol "funcidx" C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(65) : error 017: undefined symbol "funcidx" C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(66) : error 017: undefined symbol "funcidx" C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(68) : error 017: undefined symbol "CallLocalFunction" C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(83) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandText") C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(85) : error 017: undefined symbol "CallLocalFunction" C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(94) : error 017: undefined symbol "tolower" C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(96) : warning 217: loose indentation C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(96) : error 017: undefined symbol "format" C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(96) : warning 202: number of arguments does not match definition C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(96) : warning 202: number of arguments does not match definition C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(96) : warning 202: number of arguments does not match definition C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(97) : warning 217: loose indentation C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(98) : warning 217: loose indentation C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(102) : error 017: undefined symbol "CallLocalFunction" C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(104) : error 017: undefined symbol "CallLocalFunction" C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(108) : error 017: undefined symbol "CallLocalFunction" C:\Users\cex\Desktop\Game Files\Grand County Roleplay\pawno\include\zcmd.inc(110) : error 017: undefined symbol "CallLocalFunction" C:\Users\cex\Desktop\burn.pwn(6) : error 017: undefined symbol "PlayerInfo" C:\Users\cex\Desktop\burn.pwn(6) : warning 215: expression has no effect C:\Users\cex\Desktop\burn.pwn(6) : error 001: expected token: ";", but found "]" C:\Users\cex\Desktop\burn.pwn(6) : error 029: invalid expression, assumed zero C:\Users\cex\Desktop\burn.pwn(6) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
#include <a_samp>
#include <zcmd>
command(burn, playerid, params[]) //This is how the ZCMD processor is used, this is creating the command so it can be used and perform the required code.
{
for(new i=0; i<MAX_PLAYERS; i++) //This will create a loop to see who is connected to the server.
{
if(IsPlayerConnected(i)) //This will check the loop to see if the player(s) are connected, and if so they will be selected and the music file will be played out to them.
{
PlayAudioStreamForPlayer(i,"http://dl.farskids405.com/Aria/92/4/15/Ellie%20Goulding%20-%20Burn%20[128].mp3"); //This function will grab the mp3 file from the URL, then play it back to the connected players.
SendClientMessageToAll(-1, "Track playing-Ellie Goulding - Burn"); //This will send a message to all connected players, notifying them that "Ellie Goulding - Burn" is playing.
}
}
return 1;
}
Also there's bug.
You should use SendClientMessage instead SendClientMessageToAll, because it'll send many times to each player. |
CMD:burn(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return 0;
for(new i=0; i<MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i,"http://dl.farskids405.com/Aria/92/4/15/Ellie%20Goulding%20-%20Burn%20[128]. mp3");
SendClientMessageToAll(COLOR_GREEN,"Track playing-Ellie Goulding - Burn");
return 1;
}
return 1;
}
pawn Код:
|
command(burn, playerid, params[]) //This is how the ZCMD processor is used, this is creating the command so it can be used and perform the required code.
{
for(new i=0; i<MAX_PLAYERS; i++) //This will create a loop to see who is connected to the server.
{
if(IsPlayerConnected(i)) //This will check the loop to see if the player(s) are connected, and if so they will be selected and the music file will be played out to them.
{
PlayAudioStreamForPlayer(i,"http://dl.farskids405.com/Aria/92/4/15/Ellie%20Goulding%20-%20Burn%20[128].mp3"); //This function will grab the mp3 file from the URL, then play it back to the connected players.
}
}
SendClientMessageToAll(-1, "Track playing-Ellie Goulding - Burn"); //This will send a message to all connected players, notifying them that "Ellie Goulding - Burn" is playing.
return 1;
}