Send message to all - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Send message to all (
/showthread.php?tid=86810)
Send message to all -
GhOstY93 - 16.07.2009
I need some help...i have Sneaky's anti C-bug...i edited some things in it but i don't know what to add so it will send a message to everyone: IE: "playername[id] was kicked-->C-Bugging"
please help me....
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE && oldkeys & KEY_CROUCH && IsCbugWeapon(playerid))
{
P_CBUG_TICKS[playerid] ++;
if(P_CBUG_TICKS[playerid] > C_BUG_TIME)
{
P_CBUG_TICKS[playerid] = 0;
SendClientMessage(playerid,RED,"C-bugging is not allowed noob!");
Kick(playerid);
}
}
return 1;
}
Re: Send message to all -
kc - 16.07.2009
replace
pawn Код:
SendClientMessage(playerid,RED,"C-bugging is not allowed noob!");
with
pawn Код:
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "%s was kicked-->C-Bugging", name);
SendClientMessageToAll(RED,str);
Re: Send message to all -
GhOstY93 - 16.07.2009
Quote:
Originally Posted by kc
replace
pawn Код:
SendClientMessage(playerid,RED,"C-bugging is not allowed noob!");
with
pawn Код:
new str[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(str, sizeof(str), "%s was kicked-->C-Bugging", name); SendClientMessageToAll(RED,str);
|
Thanks... now i know how to script this..
![Cheesy](images/smilies/biggrin.png)
Edit: Do you know how to add his id too?
Re: Send message to all -
kc - 16.07.2009
replace
pawn Код:
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "%s was kicked-->C-Bugging", name);
SendClientMessageToAll(RED,str);
with
pawn Код:
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "%s(%d) was kicked-->C-Bugging", name, playerid);
SendClientMessageToAll(RED,str);
Re: Send message to all -
GhOstY93 - 16.07.2009
Thanks..your converter rox btw