SA-MP Forums Archive
will it be eequal to? - 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)
+--- Thread: will it be eequal to? (/showthread.php?tid=504620)



will it be eequal to? - RyanPetersons - 05.04.2014

pawn Код:
if(GetPlayerName(playerid,Nam,sizeof(Nam)) == dini_Int(file1,"Member1"))
{
dini_Set(file1,"Member1",Nam);
}
I want to know that does the name of a certain player is same as the name written in file1 in the content "member1".
so on this stage will == will work? or it will cause a bug. if == will not work than what should i add?


Re: will it be eequal to? - RyanPetersons - 05.04.2014

sorry delete it pls


Re: will it be eequal to? - Kyle - 05.04.2014

strcmp, plus the result from dini will be an int, you need to grab the string.


Re: will it be eequal to? - Dokins - 05.04.2014

I'm not familiar with Dini or how to retrieve it's data, but it should be something like this:]

pawn Код:
new string[24];
    new name[24];
    name = GetPlayerName(playerid,Nam,sizeof(Nam));
    format(string, sizeof(string), "%s",dini_Int(file1,"Member1"));
    if(strcmp(name, string, true) == 0)
    {

        dini_Set(file1,"Member1",Nam);
    }