Simple Problem.
#1

Hi,
Okay so I have 2 filterscripts to make code easier to read and to not have 1000 lines in 1 script, so it confuses me.

Okay, so I have Login/Register that contains:
Код:
new Players[Info]
How can I access that variable from my second filterscript?
Thanks
Reply
#2

You can't
You mean how can you access something like

pawn Код:
new HeyImAccessable;
like that?.
Then no you can't.
Unless you put the 2nd filterscript to your gamemode or to the script you are using in.
Reply
#3

You can't. I've read that it's possible only with Pvars, unless you make an include.

Why don't you use 1 filterscript, no matter how many the lines are, it just does its work.
Reply
#4

Thanks for help guys.
Ill do it in 1 filterscript. Thanks
Reply
#5

Okay guys, I'm trying to learn pawno, but this code wont work
Код:
	new cmd[10], params[8];
	sscanf(cmdtext, "ss", cmd, params);
	
	if(!strcmp(cmd, "/Hi"))
	{
	SendClientMessage(playerid, 0xFFFFFFFF, params);
	return 1;
	}
Always returns SERVER ERROR: unknown command.
Reply
#6

pawn Код:
if(strcmp(cmdtext, "/Hi", true, 3) == 0)
{
    new str[128];
    if(sscanf(cmdtext, "s[128]", cmdtext)) return SendClientMessage(playerid, -1, "/Hi <message>");
    format(str, sizeof(str), "%s", cmdtext);
    SendClientMessage(playerid, 0xFFFFFFFF, str);
    return 1;
}
Reply
#7

Why don't you use ZCMD with sscanf and you use strcmp which is slower. It's also easier!
pawn Код:
CMD:hi(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "/Hi <message>");
    new
        str[ 128 ]
    ;
    format(str, sizeof(str), params);
    SendClientMessage(playerid, 0xFFFFFFFF, str);
    return 1;
}
Also, isnull can be used for this situation and it's better than sscanf. Any other parameter, just use sscanf as you did.
Reply
#8

Okay guys, I managed to get it working. Can you please tell me can this be hacked:

GetPVarInt
SetPVarInt


Are they server sided or client sided? By that i mean if user can hack values via Memory Trainers.

Thanks
Reply
#9

Server sided, so no.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)