Weapon Hack[Problem] - 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: Weapon Hack[Problem] (
/showthread.php?tid=387819)
Weapon Hack[Problem] -
Akcent_Voltaj - 26.10.2012
if a player has any one of these weapons we all get spammed that he has weapons and he doesent get kicked..
PHP код:
forward weaponhack(playerid);
public weaponhack(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
new string[256];
if(GetPlayerWeapon(i) == 35 || GetPlayerWeapon(i) == 37 || GetPlayerWeapon(i) == 38 || GetPlayerWeapon(i) == 17)
{
format(string, sizeof(string), "%s a primit Kick de la BOT, Motiv: Weapon Hack",sendername);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
return 1;
}
}
return 1;
}
Re: Weapon Hack[Problem] -
CoaPsyFactor - 26.10.2012
Kick(i) instead of playerid
Re: Weapon Hack[Problem] -
Faisal_khan - 26.10.2012
Here you have defined that the player who is hacking is "
i". So why are you kicking "
playerid" when he even does'nt come in the code.
So just change Kick(playerid) to Kick(i).
Re: Weapon Hack[Problem] -
CoaPsyFactor - 26.10.2012
That is right
And why do you have that parameter playerid
you don't use it in this function
Re: Weapon Hack[Problem] -
gtakillerIV - 26.10.2012
Try this:
PHP код:
forward weaponhack(playerid);
public weaponhack(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
new string[256];
if(GetPlayerWeapon(i) == 35 || GetPlayerWeapon(i) == 37 || GetPlayerWeapon(i) == 38 || GetPlayerWeapon(i) == 17)
{
format(string, sizeof(string), "%s a primit Kick de la BOT, Motiv: Weapon Hack",sendername);
SendClientMEssageToAll(COLOR_RED, string);
Kick(i);
return 1;
}
}
return 1;
}
Re: Weapon Hack[Problem] -
CoaPsyFactor - 26.10.2012
are you f*****g kidding me, gtakiller what does we talked about in 2 previous comments
?