Ban/Kick Commands With Name..
#4

I think he didn't mean that and your code doesn't even have sence, NPTechStudios:
pawn Код:
if (strcmp("/ban (playerid)", cmdtext, true, 10) == 0) // lolwut !!??
Quote:
Originally Posted by SpanishMan
i mean, only my name can BAN/KICK.. i dont have IDea :S
Answer: Use "if" and "strcmp".

pawn Код:
// I won't include the command code for banning or kicking people, I'll just show the basic stuff
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/command", true) == 0) // this could be any command
  {
    new
      Name[MAX_PLAYER_NAME];
   
    GetPlayerName(playerid, Name, 24);
    if(strcmp(Name, "thenameyouwant", true) == 0) // change "thenameyouwant" for the target name...
    {
      // this is what happens if that player's name is your name or whatever was the name you were looking for
    }
    else
    {
      // this is what happens if that name isn't the target name
    }
    return 1; // I almost forget it
  }
  return 0;
}
Reply


Messages In This Thread
Ban/Kick Commands With Name.. - by SpanishMan - 02.03.2010, 18:31
Re: Ban/Kick Commands With Name.. - by Scenario - 02.03.2010, 18:40
Re: Ban/Kick Commands With Name.. - by Jefff - 02.03.2010, 18:45
Re: Ban/Kick Commands With Name.. - by Miguel - 02.03.2010, 18:51
Re: Ban/Kick Commands With Name.. - by aircombat - 02.03.2010, 18:52
Re: Ban/Kick Commands With Name.. - by Scenario - 02.03.2010, 18:59
Re: Ban/Kick Commands With Name.. - by SpanishMan - 02.03.2010, 20:17
Re: Ban/Kick Commands With Name.. - by Jefff - 02.03.2010, 20:31

Forum Jump:


Users browsing this thread: 2 Guest(s)