SA-MP Forums Archive
SendClientMessage broken/bugged - 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: SendClientMessage broken/bugged (/showthread.php?tid=347653)



SendClientMessage broken/bugged - Connorlolz - 02.06.2012

Okay, so I wrote a string thingy for "/my" the idea is to work like /set, /my [value] [Usage]

then it sets the Player[playerid][Description] as the value.

and everything seems fine except for some strange error.

Код:
C:\Users\Connor\Desktop\Vortex1\gamemodes\VortexRoleplay.pwn(21122) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
here's the entire script:

pawn Код:
command(my, playerid, params[])
{
    new Usage[128], Value, string[128];
    if(sscanf(params, "dz", Value, Usage))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /my [value] [usage]"); //this is the broken line
        SendClientMessage(playerid, WHITE, "Usages: Description");
    }
    else
    {
        if(strlen(Usage) >= 1)
        {
            if(strcmp(Usage, "description", true) == 0)
            {
                format(string, sizeof(string), "You have set your description to %d", Value)
                SendClientMessage(playerid, WHITE, string);
                Player[playerid][Description] = Value;
            }
        }
        else
        {
            return 1;
        }
    }
    return 1;
}



Re: SendClientMessage broken/bugged - MP2 - 02.06.2012

You're missing a semi-colon (;) on the format() line.


Re: SendClientMessage broken/bugged - MadeMan - 02.06.2012

pawn Код:
format(string, sizeof(string), "You have set your description to %d", Value)
You have a ';' missing at the end of the line.


Re: SendClientMessage broken/bugged - Connorlolz - 02.06.2012

Quote:
Originally Posted by MP2
Посмотреть сообщение
You're missing a semi-colon ( on the format() line.
I can't believe I missed that.

Thanks!


Re: SendClientMessage broken/bugged - TheDominator - 02.06.2012

Anyone can miss such a simple mistake, nothing to be ashamed about