Quote:
Originally Posted by Bakr
The above method will only check if the whole name is equal to the tag name. I'm assuming you want it to only kick the player if the tag is not in the name at all? Here is an example of how you could accomplish this:
pawn Код:
public OnPlayerConnect ( playerid ) { new name [ MAX_PLAYER_NAME ]; // Create a new variable to store the player's name GetPlayerName ( playerid, name, MAX_PLAYER_NAME ); // Store the player's name // Check if their name has the [ABC] or [123] tag // strfind usage - https://sampwiki.blast.hk/wiki/Strfind if( strfind( name, "[ABC]", true ) == -1 && strfind( name, "[123]", true ) == -1 ) { // Tell the player what's happening, and kick them SendClientMessage ( playerid, 0xFF00FFFF, "Your name must contain the [ABC] or [123] tag to play." ); Kick ( playerid ); } return 1; }
If there is a part of the code you don't understand or need more explanation of, please ask! It's better to understand the code itself instead of simply getting someone else to hand it to you every time. That way, you'll be able to replicate it in the future, if needed.
|
Ok thanks I understand what you did. I just needed a little remembering on how to script. Thanks alot dude!
what if i had a
Thanks all i needed was some remembering