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



Error... - Gooday - 05.12.2011

[pawn]
CMD:911(playerid,params[])
{
if(GetPlayerSkin(playerid) == 170 || GetPlayerSkin(playerid) == 184 || GetPlayerSkin(playerid) == 56 || GetPlayerSkin(playerid) == 30 || GetPlayerSkin(playerid) == 50 || GetPlayerSkin(playerid) == 106 || GetPlayerSkin(playerid) == 226 || GetPlayerSkin(playerid) == 235 ||GetPlayerSkin(playerid) == 240 || GetPlayerSkin(playerid) == 250 || GetPlayerSkin(playerid) == 69 || GetPlayerSkin(playerid) == 183 || GetPlayerSkin(playerid) == 60 || GetPlayerSkin(playerid) == 233 || GetPlayerSkin(playerid) == 55) //replace this with your Cop Skins+FF/EMS Skins. if(GetPlayerSkin(playerid) == 285 || GetPlayerSkin(playerid) == 286...)

if(isnull(params)) return SendClientMessage(playerid,-1,"Usage: /911 Message and Locations");
new name[24],msg[128];
GetPlayerName(playerid,name,24);
format(msg,128,"***911 Call: %s(%d): %s",name,playerid, params);
for(new i=0;i<MAX_PLAYERS;i++)
if(GetPlayerSkin(i) == 285 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288 ||GetPlayerSkin(playerid) == 278 || GetPlayerSkin(playerid) == 275 || GetPlayerSkin(playerid) == 279 || GetPlayerSkin(playerid) == 277 || GetPlayerSkin(playerid) == 274 || GetPlayerSkin(playerid) == 276) SendClientMessage(i,COLOR_GOLD,msg); // same as above for skins
return 1;
}[pawn]

Quote:

C:\Documents and Settings\Luca\Desktop\BaseScript\gamemodes\base.pw n(589) : error 075: input line too long (after substitutions)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

*2 nd Script line is line 588.... Please help!


Re: Error... - Speed - 05.12.2011

pawn Код:
input line too long (after substitutions)
try to shrink your code


Re: Error... - Ash. - 05.12.2011

You can only have something like 7 if statements in any one if block; try reducing them (perhaps using a switch statement instead?)

pawn Код:
switch(GetPlayerSkin(playerid))
{
     case skinid1, skinid2, skinid3 (etc): //If this were an if, this would be the original if line
     {
          //What you want it to do if the players skin is equal to those specific in the case line.
     }
     default: //... and this would be else
     {

     }
}