SA-MP Forums Archive
sscanf problem - 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: sscanf problem (/showthread.php?tid=177361)



sscanf problem - LZLo - 17.09.2010

begginnning (it isn't the fulll script)
PHP Code:
new DMZone[MAX_PLAYERS]; 
after onplayercommand text
PHP Code:
dcmd(t,1,cmdtext);// 
the last GM lines
PHP Code:
dcmd_t(playeridparams[])
{
    new 
string33[256], messageName;
    if(
sscanf(params"z"message)) return SendClientMessage(playeridCOLOR_ORANGE"Usage: /T [Text]");
    
format(string33sizeof(string33), "[TeamChat] %s (%d): %s"Name(playerid), playeridmessage);//20010
    
for(new 0MAX_PLAYERSi++)
    {
             if(
IsPlayerConnected(i))
            {
                 if(
DMZone(i) == DMZone(playerid))    SendClientMessage(iYELLOWstring33);
            }
    }
    return 
1;

errors and warnings:
Quote:

FULLHOUSE.pwn(20010) : error 012: invalid function call, not a valid address
FULLHOUSE.pwn(20010) : warning 215: expression has no effect
FULLHOUSE.pwn(20010) : error 001: expected token: ";", but found ")"
FULLHOUSE.pwn(20010) : error 029: invalid expression, assumed zero
FULLHOUSE.pwn(20010) : fatal error 107: too many error messages on one line




Re: sscanf problem - Cameltoe - 17.09.2010

Shoud be DMZone[i] not DMZone(i)

Not an sscanf related problem at all ..


Re: sscanf problem - LZLo - 17.09.2010

nothing

for example there is a code
DMZone[playerid] = 1;
DMZone[playerid] = 2;
and so


Re: sscanf problem - LZLo - 17.09.2010

can anyone help?


Re: sscanf problem - Cameltoe - 17.09.2010

Change the for loop to:
pawn Code:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
             if(IsPlayerConnected(i))
            {
                 if(DMZone[i] == DMZone[playerid])    SendClientMessage(i, YELLOW, string33);
            }
    }
Makes sense doesn't it?


Re: sscanf problem - LZLo - 17.09.2010

it doesen't work

i have done an other a minute 1 testing that


Re: sscanf problem - LZLo - 17.09.2010

and the sscanf is the best plugin, i think

sry Y_Less but it's the truth


Re: sscanf problem - LZLo - 17.09.2010

ooooo it's working

by the way, what server do you have Y_Less?


Re: sscanf problem - Cameltoe - 17.09.2010

At this forum we have some rules:


* No SPAM. If you are adding no useful information to a topic, you are spamming.

* Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 12 hours old, and it needs to have useful information about your problem.


Re: sscanf problem - LZLo - 17.09.2010

ok thx for the answer