[Help] Double Message in ADMIN CMD - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Double Message in ADMIN CMD (
/showthread.php?tid=530464)
[Help] Double Message in ADMIN CMD -
ROXYhunter - 07.08.2014
Help Double Message When Give all Player Weapon.....
This My Script
pawn Код:
CMD:giveallweapon(playerid, params[])
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new weapid, ammo;
if(sscanf(params,"dd", weapid, ammo)) return SendClientMessage(playerid, RED,"[USAGE]: /giveallweapon [weapon] [ammo]");
if(IsValidWeapon(weapid))
if(IsPlayerConnected(i))
{
new pName[MAX_PLAYER_NAME];
GivePlayerWeapon(i, weapid, ammo);
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
new str[150];
format(str, sizeof(str),"Administrator %s has given everyone %d ammo of weapon id : %d", pName, ammo, weapid);
SendClientMessageToAll(COLOR_ORANGE, str);
}
else return SendClientMessage(playerid, COLOR_ORANGE,"You are not allowed to give this weapon!");
}
else return SendClientMessage(playerid, RED,"You Are Not Administrator");
}
return 1;
}
Re: [Help] Double Message in ADMIN CMD -
ViniBorn - 07.08.2014
Try this
pawn Код:
CMD:giveallweapon(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2)
return SendClientMessage(playerid, RED,"You Are Not Administrator");
new weapid, ammo;
if(sscanf(params,"dd", weapid, ammo))
return SendClientMessage(playerid, RED,"[USAGE]: /giveallweapon [weapon] [ammo]");
if(!IsValidWeapon(weapid))
return SendClientMessage(playerid, COLOR_ORANGE,"You are not allowed to give this weapon!");
new str[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(str, sizeof(str),"Administrator %s has given everyone %d ammo of weapon id : %d", pName, ammo, weapid);
SendClientMessageToAll(COLOR_ORANGE, str);
for(new i; i < MAX_PLAYERS; i ++)
if(IsPlayerConnected(i))
GivePlayerWeapon(i, weapid, ammo);
return 1;
}
Re: [Help] Double Message in ADMIN CMD -
ROXYhunter - 07.08.2014
Thanks Working..
Whats wrong in my script
Quote:
Originally Posted by ViniBorn
Try this
pawn Код:
CMD:giveallweapon(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, RED,"You Are Not Administrator");
new weapid, ammo; if(sscanf(params,"dd", weapid, ammo)) return SendClientMessage(playerid, RED,"[USAGE]: /giveallweapon [weapon] [ammo]");
if(!IsValidWeapon(weapid)) return SendClientMessage(playerid, COLOR_ORANGE,"You are not allowed to give this weapon!");
new str[128], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(str, sizeof(str),"Administrator %s has given everyone %d ammo of weapon id : %d", pName, ammo, weapid); SendClientMessageToAll(COLOR_ORANGE, str);
for(new i; i < MAX_PLAYERS; i ++) if(IsPlayerConnected(i)) GivePlayerWeapon(i, weapid, ammo);
return 1; }
|
sorry for my bad english
Re: [Help] Double Message in ADMIN CMD -
ViniBorn - 07.08.2014
SendClientMessageToAll send 1 message to all online players, and you were using this with loop : for(
new...
Re: [Help] Double Message in ADMIN CMD -
ROXYhunter - 07.08.2014
Quote:
Originally Posted by ViniBorn
SendClientMessageToAll send 1 message to all online players, and you were using this with loop : for(new...
|
OMG Guys Thank's Alot..