Errors - 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: Errors (
/showthread.php?tid=423813)
Errors -
Ananisiki - 19.03.2013
^^^^^^^^
Re: Errors -
Jstylezzz - 19.03.2013
Maybe you're missing something in the code above, can you check that and show us the code?
Re: Errors -
Ananisiki - 19.03.2013
^^^^^^^^
Re: Errors -
Jstylezzz - 19.03.2013
Are the errors gone when you delete/comment that line?
EDIT: I notice there are 9 brackets in total, which is not good. In this case, you need 8 or 10 brackets. Make sure all if statements are opened/closed correctly.
Re: Errors -
Ananisiki - 19.03.2013
^^^^^^^^
Re: Errors -
Jstylezzz - 19.03.2013
Like I said in my post edit, check the brackets, I think it's that.
Re: Errors -
Scenario - 19.03.2013
Try this:
pawn Код:
CMD:highlight(playerid,params[])
{
new playername[MAX_PLAYERS];
if(!IsCnRAdmin(playerid))
return UnknownCMD(playerid);
if(!strlen(params))
return SendClientMessage(playerid, COLOR_RED, "USAGE: /highlight [PlayerID]");
new string[128];
playerid = strval(params);
if(IsPlayerConnected(playerid) && playerid != INVALID_PLAYER_ID)
{
GetPlayerName(playerid, playername, sizeof(playername));
if(AccInfo[playerid][blip] == 0)
{
AdminCMD(playerid, "HIGHLIGHT");
AccInfo[playerid][pColour] = GetPlayerColor(player1);
AccInfo[playerid][blip] = 1;
BlipTimer[player1] = SetTimerEx("HighLight", 1000, 1, "i", player1);
format(string,sizeof(string),"|- You have Highlighted %s's marker -|", PlayerName);
}
else
{
KillTimer( BlipTimer[playerid]);
AccInfo[playerid][blip] = 0;
SetPlayerColor(player1, AccInfo[player1][pColour]);
format(string,sizeof(string),"|- You have Stopped Highlighting %s's marker -|", PlayerName);
}
}
else return SendClientMessage(playerid,yellow,string);
return 1;
}
Remember that
proper indentation is key.
Re: Errors -
Ananisiki - 19.03.2013
^^^^^^^^
Re: Errors -
Scenario - 19.03.2013
Perhaps the fact that you're just ripping things from other scripts is why you have a boat load of errors? Have you ever considered looking at the main functions of the code itself and re-writing it to suit your script's needs?
Re: Errors -
Ananisiki - 19.03.2013
^^^^^^^^