error 033 giving rep - 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 033 giving rep (
/showthread.php?tid=508469)
error 033 giving rep -
iBots - 22.04.2014
well i have made a command to give the player -pot,like take pot from him and he is offline,i made:
pawn Code:
CMD:opot(playerid, params[])
{
new pot[128], target[MAX_PLAYER_NAME], amount;
if(pInfo[playerid][pAdminLevel] >= 1)
{
if(!sscanf(params, "s[128]d", target, amount))
{
format(targetname, sizeof(targetname), "%s.ini",target);
if(dini_Exists(target))
{
pot = dini_Get(targetname, "Pot");
dini_IntSet(target, "Pot", pot-amount);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "That player does not exist!");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /opot [full name] [amount]");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
}
return 1;
}
and iget this error:
pawn Code:
error 033: array must be indexed (variable "pot")
what to do?
Re: error 033 giving rep -
Jochemd - 22.04.2014
Pot is a string, not an integer, you should use
pawn Code:
dini_IntSet(target, "Pot", strval(pot) - amount);
Oh yeah, I doubt you give any positive rep.
Re: error 033 giving rep -
iBots - 22.04.2014
I will try it if it works i will give you 2 reps !!!!!!