strings
#1

Hello ,
I have a problem with strings, for example I'm making a command /car [engine]
so I made a new string
pawn Код:
new enginestr[12];
then
pawn Код:
if (enginestr == "engine")
{
//code
}
I get this error
Код:
array must be indexed (variable "enginestr")
Reply
#2

pawn Код:
if(!strcmp(enginestr, "engine"))
Reply
#3

alright , this one will compare enginestr and "engine" right? so with the "!" it means ( if enginestr and "engine" are not the same)
Am I right
thanks +rep
Reply
#4

no that means if enginestr and "engine" are the same
Reply
#5

It means that there aren't any difference between both strings.
Reply
#6

thanks
Reply
#7

Yeah, so it means they are the same
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)