Fine: GivePlayerMoney - 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: Fine: GivePlayerMoney (
/showthread.php?tid=454204)
Fine: GivePlayerMoney -
wumpyc - 28.07.2013
Hello I'm trying to setup a function that takes money from victim and gives money to the cop (fine) And I keep getting errors :/
Код:
Police_Fine(playerid)
{
foreach(new i : Player){
if(IsPlayerConnected(i)){
new vehicleid = GetPlayerVehicleID(i),Float:x,Float:y,Float:z,string[128];
if (PlayerInfo[i][pFines] > 0 && GetVehicleSpeed(vehicleid) < 30){
GetPlayerPos(i,x,y,z);
if(IsPlayerInRangeOfPoint(playerid,10.0,x,y,z)){
GivePlayerMoney(playerid,+PlayerInfo[i][pFines]); //line 1037
GivePlayerMoney(i,-PlayerInfo[i][pFines]);
PlayerInfo[i][pFines] = 0;
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Fines",PlayerInfo[i][pFines]);
INI_Close(File);
}
}
}
}
return 1;
}
Код:
C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1037) : error 029: invalid expression, assumed zero
C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1037) : warning 215: expression has no effect
C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1037) : error 001: expected token: ";", but found ")"
C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1037) : error 029: invalid expression, assumed zero
C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1037) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Fine: GivePlayerMoney -
wumpyc - 28.07.2013
Ah lol got it figured out