SA-MP Forums Archive
--->ResetPlayerWeapons<--- - 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: --->ResetPlayerWeapons<--- (/showthread.php?tid=276106)



- Serifukas - 12.08.2011

Hello Everybody.

I Make Anti Guns System Like This And Now I Need When Player Get Wrong Weapon Like Minigun Or Else
before player kicked from his remove weapons how to do this maybe someone can help ?

This Is My Anti Guns Code :

Код:
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
new str[128];
new weaponid = GetPlayerWeapon(playerid);

    if(weaponid == 38 )
    {
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    ResetPlayerWeapons(playerid);
	Kick(playerid);
}
    if(weaponid == 9 )
    {
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    ResetPlayerWeapons(playerid);
	Kick(playerid);
}
    if(weaponid == 26 )
    {
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    SetPlayerAmmo(playerid,26,0);
	Kick(playerid);
}
    if(weaponid == 35 )
    {
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    ResetPlayerWeapons(playerid);
	Kick(playerid);
}
    if(weaponid == 36 )
    {
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    ResetPlayerWeapons(playerid);
	Kick(playerid);
}
    if(weaponid == 37 )
    {
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    ResetPlayerWeapons(playerid);
	Kick(playerid);
}
    if(weaponid == 16 )
    {
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    ResetPlayerWeapons(playerid);
	Kick(playerid);
}
    if(weaponid == 18 )
    {
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    ResetPlayerWeapons(playerid);
	Kick(playerid);
}
    if(weaponid == 39 )
    {
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    ResetPlayerWeapons(playerid);
	Kick(playerid);
}
	if(weaponid == 44 )
    {
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    ResetPlayerWeapons(playerid);
	Kick(playerid);
}
    if(weaponid == 45 )
    {
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    ResetPlayerWeapons(playerid);
	Kick(playerid);
    }
    return 1;
}
I added reset code in this script but its don't work ResetPlayerWeapons(playerid);


Re: --->ResetPlayerWeapons<--- - Kaperstone - 12.08.2011

try this:
pawn Код:
#include <a_samp>
#define None 0
#define RED 0x667788
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWeapon(playerid) == 38 || GetPlayerWeapon(playerid) == 9 || GetPlayerWeapon(playerid) == 26 || GetPlayerWeapon(playerid) == 35 || GetPlayerWeapon(playerid) == 36 || GetPlayerWeapon(playerid) == 37 || GetPlayerWeapon(playerid) == 16 || GetPlayerWeapon(playerid) == 18 || GetPlayerWeapon(playerid) == 39 || GetPlayerWeapon(playerid) == 44 || GetPlayerWeapon(playerid) == 45)
    {
    new Name[MAX_PLAYER_NAME];
    new str[128];
    GetPlayerName(playerid,Name,sizeof(Name));
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    GivePlayerWeapon(playerid, 38, None);
    GivePlayerWeapon(playerid, 9, None);
    GivePlayerWeapon(playerid, 26, None);
    GivePlayerWeapon(playerid, 35, None);
    GivePlayerWeapon(playerid, 36, None);
    GivePlayerWeapon(playerid, 37, None);
    GivePlayerWeapon(playerid, 16, None);
    GivePlayerWeapon(playerid, 18, None);
    GivePlayerWeapon(playerid, 39, None);
    GivePlayerWeapon(playerid, 44, None);
    GivePlayerWeapon(playerid, 45, None);
    }
    return 1;
}



Re: --->ResetPlayerWeapons<--- - Serifukas - 12.08.2011

Don't Work :S And I Need With Kick


Re: --->ResetPlayerWeapons<--- - MadeMan - 12.08.2011

Why do you want to reset the weapons if you are going to kick the player anyway?


Re: --->ResetPlayerWeapons<--- - Serifukas - 12.08.2011

Because i want then player was kicked next time then he come to server he will not cheating.
And then he kicked from server reset guns and next time then he come with no cheats he will don't get kick.
If I leave in this script just with kick then player come next time with no cheats he again be kicked from the server because he will have weapons.


Re: --->ResetPlayerWeapons<--- - Kaperstone - 12.08.2011

Quote:
Originally Posted by Serifukas
Посмотреть сообщение
Because i want then player was kicked next time then he come to server he will not cheating.
And then he kicked from server reset guns and next time then he come with no cheats he will don't get kick.
If I leave in this script just with kick then player come next time with no cheats he again be kicked from the server because he will have weapons.
lol dude..
if you kick somone then he come back he will not have the weapons he had+if he will have then the server will kick him again.

and Script:
pawn Код:
#include <a_samp>
#define None 0
#define RED 0x667788
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWeapon(playerid) == 38 || GetPlayerWeapon(playerid) == 9 || GetPlayerWeapon(playerid) == 26 || GetPlayerWeapon(playerid) == 35 || GetPlayerWeapon(playerid) == 36 || GetPlayerWeapon(playerid) == 37 || GetPlayerWeapon(playerid) == 16 || GetPlayerWeapon(playerid) == 18 || GetPlayerWeapon(playerid) == 39 || GetPlayerWeapon(playerid) == 44 || GetPlayerWeapon(playerid) == 45)
    {
    new Name[MAX_PLAYER_NAME];
    new str[128];
    GetPlayerName(playerid,Name,sizeof(Name));
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    GivePlayerWeapon(playerid, 38, None);
    GivePlayerWeapon(playerid, 9, None);
    GivePlayerWeapon(playerid, 26, None);
    GivePlayerWeapon(playerid, 35, None);
    GivePlayerWeapon(playerid, 36, None);
    GivePlayerWeapon(playerid, 37, None);
    GivePlayerWeapon(playerid, 16, None);
    GivePlayerWeapon(playerid, 18, None);
    GivePlayerWeapon(playerid, 39, None);
    GivePlayerWeapon(playerid, 44, None);
    GivePlayerWeapon(playerid, 45, None);
    Kick(playerid);
    }
    return 1;
}
OR :
pawn Код:
#include <a_samp>
#define RED 0x667788
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWeapon(playerid) == 38 || GetPlayerWeapon(playerid) == 9 || GetPlayerWeapon(playerid) == 26 || GetPlayerWeapon(playerid) == 35 || GetPlayerWeapon(playerid) == 36 || GetPlayerWeapon(playerid) == 37 || GetPlayerWeapon(playerid) == 16 || GetPlayerWeapon(playerid) == 18 || GetPlayerWeapon(playerid) == 39 || GetPlayerWeapon(playerid) == 44 || GetPlayerWeapon(playerid) == 45)
    {
    new Name[MAX_PLAYER_NAME];
    new str[128];
    GetPlayerName(playerid,Name,sizeof(Name));
    format(str,sizeof(str),"%s: Kicked For Gun Hack!",Name);
    SendClientMessageToAll(RED,str);
    ResetPlayerWeapons(playerid);
    Kick(playerid);
    }
    return 1;
}