Warning when someone gets a gun.
#1

How to do when someone gets a gun it prints a message ?
I tried to do this but I faild. I mean when he gets the gun I want it to send only ONE message.
How to do this? thank u.
Reply
#2

u mean if someone has a certain guy , it sends a notify to all server "name has a gun" ?
Reply
#3

Quote:
Originally Posted by [AC
Etch ]
u mean if someone has a certain guy , it sends a notify to all server "name has a gun" ?
No.
When someone gets a gun from somewhere (for example cheats,but from admin too) it sends a clientmessagetoall.
Reply
#4

Timers...?
Checking players weapons between ticks or something.
Reply
#5

Quote:
Originally Posted by gotenks918
Timers...?
Checking players weapons between ticks or something.
As I said, I tried to do that and faild.
Reply
#6

Hehe, well i'm not really a scripter so I can't help sorry
Reply
#7

Start using YUP, it'll help you with this.

pawn Код:
public OnPlayerWeaponSlotChange(playerid, slot, oldweapon, newweapon)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, MAX_PLAYER_NAME);

  new string[64];
  format(string, sizeof(string), "%s got weapon %d.", name, newweapon);
  SendClientMessageToAll(0xFF0000FF, string);

  return 1;
}
It also has many other useful callbacks;
Код:
forward OnPlayerWeaponChange(playerid, oldweapon, newweapon);
forward OnPlayerAmmoChange(playerid, oldammo, newammo);
forward OnPlayerHealthChange(playerid, Float:oldhealth, Float:newhealth);
forward OnPlayerArmourChange(playerid, Float:oldarmour, Float:newarmour);
forward OnPlayerMoneyChange(playerid, oldmoney, newmoney);
forward OnPlayerWeaponSlotChange(playerid, slot, oldweapon, newweapon);
forward OnPlayerUnpause(playerid);
forward OnPlayerPause(playerid);
forward OnPlayerExpire(playerid);
Reply
#8

Thank you very much but the link is broken.

EDIT: Okay I found a mirror - Thanks!
Reply
#9

Quote:
Originally Posted by Uniqueee
Thank you very much but the link is broken.
No it isent
Reply
#10

Quote:
Originally Posted by Finn
Start using YUP, it'll help you with this.

pawn Код:
public OnPlayerWeaponSlotChange(playerid, slot, oldweapon, newweapon)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, MAX_PLAYER_NAME);

  new string[64];
  format(string, sizeof(string), "%s got weapon %d.", name, newweapon);
  SendClientMessageToAll(0xFF0000FF, string);

  return 1;
}
It also has many other useful callbacks;
Код:
forward OnPlayerWeaponChange(playerid, oldweapon, newweapon);
forward OnPlayerAmmoChange(playerid, oldammo, newammo);
forward OnPlayerHealthChange(playerid, Float:oldhealth, Float:newhealth);
forward OnPlayerArmourChange(playerid, Float:oldarmour, Float:newarmour);
forward OnPlayerMoneyChange(playerid, oldmoney, newmoney);
forward OnPlayerWeaponSlotChange(playerid, slot, oldweapon, newweapon);
forward OnPlayerUnpause(playerid);
forward OnPlayerPause(playerid);
forward OnPlayerExpire(playerid);
It does not work.
I have put the include and the filterscripts in my server and everything and when I run it everything is okay, it says ****** at the start but that doesn't give a warning when someone gets a gun.
I didn't add a timer, maybe this is the problem?
I only added your code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)