SA-MP Forums Archive
how to fix that ????? - 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: how to fix that ????? (/showthread.php?tid=185526)



how to fix that ????? - MBX97 - 25.10.2010

i have a code and it have a lil problem with pawno , the code is this
Код:
if (strcmp("/gw", cmdtext, true, 10) == 0)
		{
		if(IsPlayerAdmin(playerid))
		SendClientMessage(playerid, COLOR_YELLOW, "================GW Admins Help=============");
		SendClientMessage(playerid, COLOR_YELLOW, "================/hi, /gw=============");
		SendClientMessage(playerid, COLOR_YELLOW, "================GW Admins Help=============");
		else
  		{
		SendClientMessage(playerid, 0xff0000ff, "You are not an admin !!!");
		}
		return 1;
		}
so thats the code and the error is :
Quote:

error 029: invalid expression, assumed zero

what should i do , and how to fix that , i didn't meet any error in my life like this fuckin error ,
btw sorry for the word F@#K


Re: how to fix that ????? - Miguel - 25.10.2010

If you indent your code, you will notice you missed some brackets:

Indented:
pawn Код:
if (strcmp("/gw", cmdtext, true, 10) == 0) // you don't need to specify how many characters you're going to use (10)
{
    if(IsPlayerAdmin(playerid))
    // there should be a bracket here
        SendClientMessage(playerid, COLOR_YELLOW, "================GW Admins Help=============");
        SendClientMessage(playerid, COLOR_YELLOW, "================/hi, /gw=============");
        SendClientMessage(playerid, COLOR_YELLOW, "================GW Admins Help=============");
    // same here
    else
    {
        SendClientMessage(playerid, 0xff0000ff, "You are not an admin !!!");
    }
    return 1;
}
Fix:
pawn Код:
if (strcmp("/gw", cmdtext, true) == 0)
{
    if(IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid, COLOR_YELLOW, "================GW Admins Help=============");
        SendClientMessage(playerid, COLOR_YELLOW, "================/hi, /gw=============");
        SendClientMessage(playerid, COLOR_YELLOW, "================GW Admins Help=============");
    }
    else
    {
        SendClientMessage(playerid, 0xff0000ff, "You are not an admin !!!");
    }
    return 1;
}



Re: how to fix that ????? - MBX97 - 25.10.2010

i'll try and btw U R The BEST Miguel , thanks very much
sooooooooooooo much thx


Re: how to fix that ????? - MBX97 - 25.10.2010

but how u create the pawn Code: with colors


Re: how to fix that ????? - Miguel - 25.10.2010

Use [ pawn] code here [ /pawn] tags instead of [ code] [ /code].


Re: how to fix that ????? - Hal - 25.10.2010

Quote:
Originally Posted by MBX97
Посмотреть сообщение
but how u create the pawn Code: with colors
can you also stop constantly double posting....


Re: how to fix that ????? - MBX97 - 25.10.2010

again thanks


Re: how to fix that ????? - MBX97 - 25.10.2010

pawn Код:
new string[128];
sorry just testing it