SoundID Script -
[IND]Crazy - 28.06.2013
i try to create sound id heared for all player .
this is my script , but not work
pawn Код:
CMD:Thank(playerid,params[]) {
#pragma unused params
if(PlayerInfo[playerid][Level] >= 3) {
PlayerPlaySound(playerid,5453,0.0,0.0,0.0);
format(string,sizeof(string),"{dd0000}%s : Thank you sir have a nice day!", Name );
SendClientMessageToAll(-1,string);
return 1;
} else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
}
anyone can help me ?
Re: SoundID Script -
Cjgogo - 28.06.2013
You need a loop:
pawn Код:
CMD:Thank(playerid,params[])
{
#pragma unused params
if(PlayerInfo[playerid][Level] >= 3)
{
for(new i=0;i<MAX_PLAYERS;i++)
{PlayerPlaySound(i,5453,0.0,0.0,0.0);}
format(string,sizeof(string),"{dd0000}%s : Thank you sir have a nice day!", Name );
SendClientMessageToAll(-1,string);
}
else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
}
Re: SoundID Script -
Kirollos - 28.06.2013
thats the correct code if i understood well what did you mean
pawn Код:
CMD:Thank(playerid,params[]) {
#pragma unused params
if(PlayerInfo[playerid][Level] >= 3) {
for(new p = 0; p < MAX_PLAYERS; p++){
if(!IsPlayerConnected(p)) continue;
PlayerPlaySound(p,5453,0.0,0.0,0.0);
}
format(string,sizeof(string),"{dd0000}%s : Thank you sir have a nice day!", Name );
SendClientMessageToAll(-1,string);
return 1;
} else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
}
EDIT: you shall look at the poster above me
Re: SoundID Script -
[IND]Crazy - 28.06.2013
wow thanks .
but i have problem , when i type /thank , eror showing
SERVER: Unknown command.
i add that script on filterscript
pawn Код:
#include <a_samp>
public OnFilterScriptInit() {
print("\n----------------------------------------------------");
print(" SoundID System");
print("----------------------------------------------------\n");
return 1;
}
CMD:Thank(playerid,params[])
{
#pragma unused params
if(PlayerInfo[playerid][Level] >= 3)
{
for(new i=0;i<MAX_PLAYERS;i++)
{PlayerPlaySound(i,5453,0.0,0.0,0.0);}
format(string,sizeof(string),"{dd0000}%s : Thank you sir have a nice day!", Name );
SendClientMessageToAll(-1,string);
}
else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
}
Re: SoundID Script -
LeeXian99 - 28.06.2013
Код:
CMD:Thank(playerid,params[])
{
#pragma unused params
if(PlayerInfo[playerid][Level] >= 3)
{
for(new i=0;i<MAX_PLAYERS;i++)
{PlayerPlaySound(i,5453,0.0,0.0,0.0);}
format(string,sizeof(string),"{dd0000}%s : Thank you sir have a nice day!", Name );
SendClientMessageToAll(-1,string);
}
else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
return 1;
}
Re: SoundID Script -
[IND]Crazy - 28.06.2013
but i have problem , when i type /thank , eror showing
SERVER: Unknown command.
i add that script on filterscript
pawn Код:
#include <a_samp>
public OnFilterScriptInit() {
print("\n----------------------------------------------------");
print(" SoundID System");
print("----------------------------------------------------\n");
return 1;
}
CMD:Thank(playerid,params[])
{
#pragma unused params
if(PlayerInfo[playerid][Level] >= 3)
{
for(new i=0;i<MAX_PLAYERS;i++)
{PlayerPlaySound(i,5453,0.0,0.0,0.0);}
format(string,sizeof(string),"{dd0000}%s : Thank you sir have a nice day!", Name );
SendClientMessageToAll(-1,string);
}
else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
}
Re: SoundID Script -
GeniusPobs - 28.06.2013
i think u forgot "return 1;" before closing the bracket.
Re : SoundID Script -
Naruto_Emilio - 28.06.2013
You forgot to add #include <zcmd>
Re: Re : SoundID Script -
[IND]Crazy - 28.06.2013
Quote:
Originally Posted by Naruto_Emilio
You forgot to add #include <zcmd>
|
this is my script
pawn Код:
#include <a_samp>
#include <zcmd>
public OnFilterScriptInit() {
print("\n----------------------------------------------------");
print(" SoundID System");
print("----------------------------------------------------\n");
return 1;
}
CMD:Thank(playerid,params[])
{
#pragma unused params
if(PlayerInfo[playerid][Level] >= 3)
{
for(new i=0;i<MAX_PLAYERS;i++)
{PlayerPlaySound(i,5453,0.0,0.0,0.0);}
format(string,sizeof(string),"{dd0000}%s : Thank you sir have a nice day!", Name );
SendClientMessageToAll(-1,string);
return 1;
}
else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
}
and i have this eror on compile when i add #include <zcmd>
pawn Код:
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\sound.pwn(20) : error 017: undefined symbol "PlayerInfo"
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\sound.pwn(20) : warning 215: expression has no effect
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\sound.pwn(20) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\sound.pwn(20) : error 029: invalid expression, assumed zero
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\sound.pwn(20) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Re: SoundID Script -
Guest123 - 28.06.2013
this ?
pawn Код:
#include <a_samp>
#include <zcmd>
public OnFilterScriptInit()
print("\n----------------------------------------------------");
print(" SoundID System");
print("----------------------------------------------------\n");
return 1;
}
CMD:Thank(playerid,params[])
{
#pragma unused params
for(new i=0;i<MAX_PLAYERS;i++)
{
new string[128];
PlayerPlaySound(i,5453,0.0,0.0,0.0);
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string,sizeof(string),"{dd0000}%s : Thank you sir have a nice day!", name);
SendClientMessageToAll(-1,string);
return 1;
}
return 1;
}