SA-MP Forums Archive
error 017: undefined symbol "params" - 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: error 017: undefined symbol "params" (/showthread.php?tid=427117)



error 017: undefined symbol "params" - LuckyPlaya` - 31.03.2013

Its from a FS i downloaded

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/setvip", cmdtext, true, 7) == 0)
    {
        if(IsPlayerAdmin(playerid))
	{
		new Target;
		new VLevel;
		new levelerror[100];
		format(levelerror,sizeof(levelerror),"{FF0000}ERROR: {FFFFFF}Maximum level is {FFFF00}%d!",MaxLevel);
		if(!sscanf(params, "ui",Target,VLevel))////<----PROBLEM
		{
			if(VLevel > MaxLevel) return SendClientMessage(playerid, COLOR_RED, levelerror);
			if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"{FF0000}ERROR: {FFFFFF}Wrong player ID!");
			PlayerData[Target][Level] = VLevel;
			new tname[MAX_PLAYER_NAME];
			GetPlayerName(Target,tname,sizeof(tname));
			new pname[MAX_PLAYER_NAME];
			GetPlayerName(playerid,pname,sizeof(pname));
			new MyString[128];
			format(MyString, sizeof(MyString), "{00FF40}SUCCES: {FFFFFF}You have set {FFFF00}%s {FFFFFF}VIP Level to {FFFF00}%i!", tname, VLevel);
			SendClientMessage(playerid,COLOR_GREEN,MyString);
			if(PlayerData[Target][Level] > 0)
			{
				TotalAccounts++;
				format(File,sizeof(File),"/fVIP/Accounts/%s.txt",tname);
				if(dini_Exists(File))
				{
					dini_IntSet(File,"AccountNumber",TotalAccounts);
				}
			}
			else if(PlayerData[playerid][Level] == 0)
			{
				TotalAccounts--;
				format(File,sizeof(File),"/fVIP/Accounts/%s.txt",tname);
				if(dini_Exists(File))
				{
					dini_Set(File,"AccountNumber","N/A");
				}
			}
		}
		else SendClientMessage(playerid, COLOR_YELLOW, "{FF0000}USAGE: {FFFFFF}/setvip <playerid> <vip-level>");
	}
	else SendClientMessage(playerid,COLOR_RED,"{FF0000}ERROR: {FFFFFF}You are not RCON Administrator!");
	return 1;
    }
    return 0;
}



Re: error 017: undefined symbol "params" - lean1337 - 31.03.2013

Do you have sscanf? it seems like you dont.


Re: error 017: undefined symbol "params" - colonel-top - 31.03.2013

If u not add sscanf try add this on ur top of scripts
pawn Код:
#include <sscanf2>
If not have this plug in u can downloaded it


Re: error 017: undefined symbol "params" - LuckyPlaya` - 31.03.2013

I have. But can you give me the link af any sscanf and i will try it again.


Re: error 017: undefined symbol "params" - colonel-top - 31.03.2013

https://sampforum.blast.hk/showthread.php?tid=120356


Re: error 017: undefined symbol "params" - LuckyPlaya` - 31.03.2013

Still the same


Re: error 017: undefined symbol "params" - RajatPawar - 31.03.2013

You can use 'params' if it is a ZCMD command, (params is a ZCMD parameter) here, I guess you can just do:
pawn Код:
CMD:setvip(playerid, params[])
{
  if(IsPlayerAdmin(playerid))
    {
        new Target;
        new VLevel;
        new levelerror[100];
        format(levelerror,sizeof(levelerror),"{FF0000}ERROR: {FFFFFF}Maximum level is {FFFF00}%d!",MaxLevel);
        if(!sscanf(params, "ui",Target,VLevel))////<----PROBLEM
        {
            if(VLevel > MaxLevel) return SendClientMessage(playerid, COLOR_RED, levelerror);
            if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"{FF0000}ERROR: {FFFFFF}Wrong player ID!");
            PlayerData[Target][Level] = VLevel;
            new tname[MAX_PLAYER_NAME];
            GetPlayerName(Target,tname,sizeof(tname));
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid,pname,sizeof(pname));
            new MyString[128];
            format(MyString, sizeof(MyString), "{00FF40}SUCCES: {FFFFFF}You have set {FFFF00}%s {FFFFFF}VIP Level to {FFFF00}%i!", tname, VLevel);
            SendClientMessage(playerid,COLOR_GREEN,MyString);
            if(PlayerData[Target][Level] > 0)
            {
                TotalAccounts++;
                format(File,sizeof(File),"/fVIP/Accounts/%s.txt",tname);
                if(dini_Exists(File))
                {
                    dini_IntSet(File,"AccountNumber",TotalAccounts);
                }
            }
            else if(PlayerData[playerid][Level] == 0)
            {
                TotalAccounts--;
                format(File,sizeof(File),"/fVIP/Accounts/%s.txt",tname);
                if(dini_Exists(File))
                {
                    dini_Set(File,"AccountNumber","N/A");
                }
            }
        }
        else SendClientMessage(playerid, COLOR_YELLOW, "{FF0000}USAGE: {FFFFFF}/setvip <playerid> <vip-level>");
    }
    else SendClientMessage(playerid,COLOR_RED,"{FF0000}ERROR: {FFFFFF}You are not RCON Administrator!");
    return 1;
}



Re: error 017: undefined symbol "params" - lekinho911 - 30.08.2013

ERRO NESSA LINHA AE
Код:
format(file, sizeof(file), PASTA_CONTAS, aname);
Код:
C:\Users\Hugo\Downloads\Server gta\samp03x_svr_R1-2_win32\gamemodes\Original.pwn(8439) : error: 017: undefined symbol "file"
C:\Users\Hugo\Downloads\Server gta\samp03x_svr_R1-2_win32\gamemodes\Original.pwn(8439) : error: 017: undefined symbol "file"
C:\Users\Hugo\Downloads\Server gta\samp03x_svr_R1-2_win32\gamemodes\Original.pwn(8439) : error: 029: invalid expression, assumed zero
C:\Users\Hugo\Downloads\Server gta\samp03x_svr_R1-2_win32\gamemodes\Original.pwn(8439) : error fatal: 107: too many error messages on one line