Code doesnt work well - 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: Code doesnt work well (
/showthread.php?tid=173400)
Code doesnt work well -
vection - 02.09.2010
pawn Код:
if(strcmp(cmd, "/checkapps", true) == 0)
{
//if(PlayerInfo[playerid][pAdmin] >= 1)
//{
new str1[1280];
format(str1, sizeof(str1), "Logs/waiters.ini");
if(!strcmp(dini_Get(str1, "Name"),"None",false))
{
format(string, sizeof(string),"%s", dini_Get(str1, "Name"));
SendClientMessage(playerid, COLOR_YELLOW, string);
}
else if(!strcmp(dini_Get(str1, "Name2"),"None",false))
{
format(string, sizeof(string),"%s", dini_Get(str1, "Name2"));
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
the problem its writing Unknown Command, in this line: if(!strcmp(dini_Get(str1, "Name2"),"None",false))
if try to make if dini_get is not None so...
what the problem?
Re: Code doesnt work well -
CyNiC - 02.09.2010
The problem is what your command is without return.
pawn Код:
if(strcmp(cmd, "/checkapps", true) == 0)
{
//if(PlayerInfo[playerid][pAdmin] >= 1)
//{
new str1[1280];
format(str1, sizeof(str1), "Logs/waiters.ini");
if(!strcmp(dini_Get(str1, "Name"),"None",false))
{
format(string, sizeof(string),"%s", dini_Get(str1, "Name"));
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
else if(!strcmp(dini_Get(str1, "Name2"),"None",false))
{
format(string, sizeof(string),"%s", dini_Get(str1, "Name2"));
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
}