• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Not sure if my /kick works?
#4
(2021-03-29, 09:32 PM)CrypticSin Wrote: Hi i've written a admin command for /kick and im currently multi logging into my server to test it out.



Everything seems like it's working when i kick my 2nd character but, it doesn't actually kick the player even though the message comes up that?they've been kicked?



Could this be because im accessing the server on two different accounts with?the same PC and the same IP??



Or if a randomer from a different ip joined would it work??



Code:

PHP Code:
CMD:kick(playeridparams[])

{

? ? if(
PlayerInfo[playerid][pAdmin] < 1)

? ? return 
SCM(playeridCOLOR_RED"You are not allowed to use this command");



new 
playerbreason[24];

new 
fstr[200];

if(
sscanf(params"us[24]"playerbreason))

? ? return 
SCM(playeridCOLOR_RED"Usage: /kick [playerid/name] [reason]");

? ? 

? ? if(!
IsPlayerConnected(playerb))

return 
SendClientMessage(playeridCOLOR_RED"Player not found.");

? ? 

? ? if(
PlayerInfo[playerb][pAdmin] >= 1)

return 
SendClientMessage(playeridCOLOR_RED"You cant kick admins.");

? ? {

? ? ? ? 
format(fstrsizeof(fstr), "Admin %s (%d) has kicked %s [%d] from TWDZS - Reason: %s"ReturnName(playerid), playeridReturnName(playerb), playerbreason);

? ? ? ? 
SendClientMessageToAll(COLOR_REDfstr);

? ? ? ? 
PlayerInfo[playerb][pKicks] ;

? ? ? ? 
GameTextForPlayer(playerb"~r~Kicked"50005);

? ? ? ? 
format(fstrsizeof(fstr), "You have been kicked from TWDZS. You were kicked by admin %s."ReturnName(playerid));

? ? ? ? 
SendClientMessage(playerbCOLOR_REDfstr);

? ? ? ? 
SendClientMessage(playerbCOLOR_ORANGE"If you think this kick is unfair complain at www.domain.net");

? ? ? ? 
KickEx(playerb);

? ? }

? ? return 
true;





Hey. Firstly remove "SCM". Just don't use it, it's really bad to use SCM, even if we talk about programming in general it's bad to use short function names.
  Reply


Messages In This Thread
Not sure if my /kick works? - by CrypticSin - 2021-03-29, 09:32 PM
RE: Not sure if my /kick works? - by destiezk - 2021-04-02, 10:07 AM
RE: Not sure if my /kick works? - by Awide - 2021-04-02, 10:27 AM
RE: Not sure if my /kick works? - by ImOver - 2021-04-03, 07:48 PM
RE: Not sure if my /kick works? - by CrypticSin - 2021-04-03, 10:08 PM

Forum Jump: