02.03.2010, 18:51
I think he didn't mean that and your code doesn't even have sence, NPTechStudios:
Answer: Use "if" and "strcmp".
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
|
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;
}