SA-MP Forums Archive
need error fix - 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: need error fix (/showthread.php?tid=526167)



need error fix - saffierr - 15.07.2014

I got this error:
Quote:

C:\Users\selma\Desktop\Samp\gamemodes\Lerenscripte n.pwn(526) : error 001: expected token: ")", but found "{"
C:\Users\selma\Desktop\Samp\gamemodes\Lerenscripte n.pwn(536) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

this is the cmd

Quote:

CMD: skin(playerid, params[])
{
new string[128], skinid;
if (IsPlayerAdmin(playerid))
{
if(sscanf(params, "d", skinid)
{
SendClientMessage(playerid, -1, "SYNTAX: /skin [ID]");
}
else
{
SetPlayerSkin(playerid, skinid);
format(string, sizeof(string), "You have set your skin to %d", skinid);
SendClientMessage(playerid, -1, string);
}
}
return 1;
}




Re: need error fix - saffierr - 15.07.2014

I did that on purpose , in my pawno its without a space, if I don't do a space it'll appear in a smiley look : s without space is a smiley that's why I spaced it


Re: need error fix - saffierr - 15.07.2014

Can someone give me a ERRORLESS /skin cmd?


Re: need error fix - Miguel - 16.07.2014

This line, there's a missing a ")".
pawn Код:
if(sscanf(params, "d", skinid)
TIP: indent your code and you will succeed.


Re: need error fix - amirab - 16.07.2014

change your code to this :
PHP код:
CMD:skin(playeridparams[])
{
new 
string[128], skinid;
if (
IsPlayerAdmin(playerid))
{
if(
sscanf(params"d"skinid))
{
SendClientMessage(playerid, -1"SYNTAX: /skin [ID]");
}
else
{
SetPlayerSkin(playeridskinid);
format(stringsizeof(string), "You have set your skin to %d"skinid);
SendClientMessage(playerid, -1string);
}
}
return 
1;




Respuesta: Re: need error fix - CuervO - 16.07.2014

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
Код:
CMD: skin(playerid, params[])
To

Код:
CMD:skin(playerid, params[])


Spacing in pawn is bad, especially when processing a command.
Compiler ignores spaces.