error 017: undefined symbol "params"
#1

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;
}
Reply
#2

Do you have sscanf? it seems like you dont.
Reply
#3

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
Reply
#4

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

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

Still the same
Reply
#7

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;
}
Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)