What's wrong with this code? -
Mikkel_RE - 12.01.2013
Hi im having a problem with this code, can you please help me?
Im getting this error on the code
Код:
C:\Users\vMikkelReimer\Desktop\Samp stuff for 0,3d June-May2012\Samp crap 2012\gf_jan12.pwn(32054) : error 029: invalid expression, assumed zero
Код:
This is the line with the error:
GiveMoney(playerid, += DropInfo[i][dAmount][0];
Код:
else if(DropInfo[i][dType] == 7) //Money
{
ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
format(string,sizeof(string),"* %s picks up $%d dollars.",Name(playerid),DropInfo[i][dAmount]);
ProxDetector(30.0,playerid,string,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
PlayerInfo[playerid][pCash] += DropInfo[i][dAmount][0];
GiveMoney(playerid, += DropInfo[i][dAmount][0];
DropInfo[i][dAmount][0] = 0;
DropInfo[i][dType] = 0;
DestroyObject(DropObject[i]);
}
return 1;
}
Re: What's wrong with this code? -
EAsT-OAK_510 - 12.01.2013
GiveMoney(playerid, += DropInfo[i][dAmount][0]);
You missed a )
Re: What's wrong with this code? -
Infinity90 - 12.01.2013
You beat me to the post -_-
Re: What's wrong with this code? -
nmader - 12.01.2013
Here's your quick fix, replace that line of code with:
pawn Код:
GiveMoney(playerid += DropInfo[i][dAdmount][0]);
That should work if I understand what you are trying to do.
Re: What's wrong with this code? -
Mikkel_RE - 12.01.2013
Now i just get these errors
Код:
C:\Users\vMikkelReimer\Desktop\Samp stuff for 0,3d June-May2012\Samp crap 2012\gf_jan12.pwn(32054) : error 017: undefined symbol "dAdmount"
C:\Users\vMikkelReimer\Desktop\Samp stuff for 0,3d June-May2012\Samp crap 2012\gf_jan12.pwn(32054) : error 029: invalid expression, assumed zero
C:\Users\vMikkelReimer\Desktop\Samp stuff for 0,3d June-May2012\Samp crap 2012\gf_jan12.pwn(32054) : warning 215: expression has no effect
C:\Users\vMikkelReimer\Desktop\Samp stuff for 0,3d June-May2012\Samp crap 2012\gf_jan12.pwn(32054) : error 001: expected token: ";", but found "]"
C:\Users\vMikkelReimer\Desktop\Samp stuff for 0,3d June-May2012\Samp crap 2012\gf_jan12.pwn(32054) : fatal error 107: too many error messages on one line
Re: What's wrong with this code? -
nmader - 12.01.2013
Who's code did you attempt?
Re: What's wrong with this code? -
nmader - 12.01.2013
Accidental double post as my computer is being rather fussy, my apologies.
Re: What's wrong with this code? -
Infinity90 - 12.01.2013
Try:
pawn Код:
GiveMoney(playerid, DropInfo[i][dAmount][0]);
That should work
Re: What's wrong with this code? -
Mikkel_RE - 12.01.2013
Thanks Infinity90 that code works