Confused.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Confused.. (
/showthread.php?tid=125445)
Confused.. -
SMCentral - 03.02.2010
How do I do...
If text == text => continue...
If(string == "boomalalala")
{
// do something
}
else
{
//Send error
}
Re: Confused.. -
nastoe - 03.02.2010
can you give us more description, what you wanna
Re: Confused.. -
SMCentral - 03.02.2010
I want to know how to know if two strings equal eachother...
Re: Confused.. -
notime - 03.02.2010
that aint gonna work like that
u have to use
if(strcmp etc. etc.)
try this:
https://sampwiki.blast.hk/wiki/Strcmp
Re: Confused.. -
SMCentral - 03.02.2010
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;
}
Re: Confused.. -
GhoulSlayeR - 03.02.2010
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;
}
Re: Confused.. -
SMCentral - 04.02.2010
Yeah, I figured out to fix it. Thanks tho.