strfind
Use this function to search for a substring in a string.
Parameters:
({{{1}}})
const string[] The string you want to search in (haystack).
const sub[] The string you want to search for (needle).
ignorecase=false Ignore capitals if true.
pos=0 The offset to start searching.
Returns The occurance of the substr, returns -1 if it's not found.
new instring = strfind("Are you in here?", "you", true); в твоем случае
if(strfind(playername, "[TMP]", true) != -1){do something}
еще есть вопросы, бот?
Добавлено (21.02.2009, 19:57)
---------------------------------------------
вот еще пример, надеюсь твоему нубомозгу хватит сил это понять
[pwn]public OnPlayerRequestSpawn(playerid)
{
new SkinID;
SkinID = GetPlayerSkin(playerid);
if(SkinID == 105 )
{
new Nick[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nick, sizeof(Nick));
if(strfind(Nick, "ObP_", true) != -1 || strfind(Nick, "ObP_", true) != -1)
{
return 1;
}
else
{
GameTextForPlayer(playerid, "~r~Only for ObP clan members", 750, 3);
return 0;
}
}
else
{
return 1;
}
}[/pwn]