Quote:
Originally Posted by asdian
thanks for your answer guys, it all works as i need now.
one last question, is it possible to get 2 chars or more like :
Code:
szCos[strlen(szCos)-4] == "this"
without using equal/equali in amxx ?
|
Yes, by using the logical operator "&&" ( AND )
Code:
// By defining a new variable which stores the string lenght, you avoid multiple function calls ( improving the performance )
new iLen = strlen(szCos)
if(szCos[iLen - 4] == 't' && szCos[iLen - 3] == 'h' && szCos[iLen - 2] == 'i' && szCos[iLen - 1] == 's')
{
// meets the criterias, execute
}
__________________