Confused..
#1

How do I do...

If text == text => continue...

If(string == "boomalalala")
{
// do something
}
else
{
//Send error
}
Reply
#2

can you give us more description, what you wanna
Reply
#3

I want to know how to know if two strings equal eachother...
Reply
#4

that aint gonna work like that
u have to use
if(strcmp etc. etc.)

try this:
https://sampwiki.blast.hk/wiki/Strcmp
Reply
#5

I have a function,

SetPlayerKOD(playerid, field[], value)

So lets say I call SetPlayerKOD(playerid, kills, 5) // This sets their kills to 5.

I've tired...

Код:
if(strcmp(field, kills, true ) == 0 ) // So if in SetPlayerKOD(playerid, field[], value), the field is kills, then do this..
{
	PlayerKills = 5;
}
Reply
#6

Don't forget to add (" ") around kills. Untested though.

Код:
if(strcmp(field, "kills", true ) == 0 ) // So if in SetPlayerKOD(playerid, field[], value), the field is kills, then do this..
{
	PlayerKills[playerid] = value;
}
Reply
#7

Yeah, I figured out to fix it. Thanks tho.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)