Kicking player - 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: Kicking player (
/showthread.php?tid=637364)
Kicking player -
Crackerz - 13.07.2017
hey guys, I was trying add a system of kicking when the server says the person is possibily hacking,
But I face error :
Code:
error 035: argument type mismatch (argument 1)
My code :
PHP Code:
if(GetPlayerState(i) == PLAYER_STATE_DRIVER && AdminDuty[i] != 1 && !IsAPlane(GetPlayerVehicleID(i))) {
new Float:fCurrentSpeed;
fCurrentSpeed = player_get_speed(i);
fVehSpeed[i] = fCurrentSpeed;
if(fCurrentSpeed > 200) {
new string[74 + MAX_PLAYER_NAME];
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) may possibly be speed hacking (%.0f MPH).", GetPlayerNameEx(i), i, fCurrentSpeed);
Kick("%d"); //<<<<<ERRROR LINE!
ABroadCast(COLOR_YELLOW, string, 1);
SetPVarInt(i, "shW", GetPVarInt(i, "shW")+1);
if(GetPVarInt(i, "shW") >= 3) {
format(string, sizeof(string), "%s may possibly have speed hacked (speeds of %.0f MPH).", GetPlayerNameEx(i), fCurrentSpeed);
AddAutomatedFlag(i, string);
}
}
}
Re: Kicking player -
StrikerZ - 13.07.2017
Re: Kicking player -
GuilhermeNunes - 13.07.2017
Coloque Kick(playerid); no final
Re: Kicking player -
StrikerZ - 13.07.2017
Quote:
Originally Posted by GuilhermeNunes
Coloque Kick(playerid); no final
|
He's using a loop, not any function which has playerid. He's looping by "i" variable, so it's
Re: Kicking player -
Meller - 13.07.2017
Your code doesn't make any sense at all.
Kick("%d");
Why even attempt using a formatted text in a string where's there no other params? Why even obhter placing a string on an int?
SetPVarInt(i, "shW", GetPVarInt(i, "shW")+1);
You do realize you just kicked player I? He wont have his virtualworld set depending on his net.
AddAutomatedFlag(i, string);
Still, he was kicked for fucks sake.