Someone gets banned with certain weapon. - 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: Someone gets banned with certain weapon. (
/showthread.php?tid=134044)
Someone gets banned with certain weapon. -
iLcke - 14.03.2010
so, say they have a minigun, how they get banned?
Код:
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
{
SendClientMessage(COLOR_RED, "Hi there, you have been banned for jetpack hacks");
Ban(playerid); // Ban players if they have a jetpack
}
thats my code for jetpack, could i change SPECIAL_ACTION to like, WEAPON_MINIGUN?
Re: Someone gets banned with certain weapon. -
Johndaone - 14.03.2010
pawn Код:
weaponid = GetPlayerWeapon(i);
if(weaponid == 38)
{
new string[128];
new plname[MAX_PLAYER_NAME];
GetPlayerName(i, plname, sizeof(plname));
format(string, 256, "%s [%d] Just spawned a minigun and got banned.",GetPlayerNameEx(i),i);
AdministratorMessage(COLOR_RED,string,1);
Ban(i);
return 1;
}
then put it in a timer or something.
//
Remember to put this in :P
for(new i=0; i<MAX_PLAYERS; i++)
Re: Someone gets banned with certain weapon. -
evanx10 - 14.03.2010
Try this:
Код:
public OnPlayerUpdate(playerid)
{
new weaponid;
weaponid = GetPlayerWeapon(playerid);
if(weaponid == 38)
{
SendClientMessage(playerid, 0xFF0000AA,"You have been banned for Minigun Hacks.");
Ban(playerid);
}
return 1;
}
It will send that message to the Hacker and Ban him when he spawns a minigun.