SA-MP Forums Archive
Help solving some 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: Help solving some errors (/showthread.php?tid=482808)



Help solving some errors - iPlaySAMPalot - 23.12.2013

Hey guys i ran into a couple errors i wasnt able to fix, Think you guys could help out?

Errors:
Код:
C:\Users\Computer\Desktop\--\gamemodes\script.pwn(10217) : error 028: invalid subscript (not an array or too many subscripts): "CP"
C:\Users\Computer\Desktop\--\gamemodes\script.pwn(10217) : warning 215: expression has no effect
C:\Users\Computer\Desktop\--\gamemodes\script.pwn(10217) : error 001: expected token: ";", but found "]"
C:\Users\Computer\Desktop\--\gamemodes\script.pwn(10217) : error 029: invalid expression, assumed zero
C:\Users\Computer\Desktop\--\gamemodes\script.pwn(10217) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Line 10217:
Код:
	CP[playerid] = 0; Robbed[playerid] = 0; SpawnChange[playerid] = 1; PlayerInfo[playerid][pPot] = 0;
Need to solve this ASAP, Thanks!


Re: Help solving some errors - TheOriginal1337 - 23.12.2013

Show more lines above and under line 10217 and we'll be able to help.


Re: Help solving some errors - Hansrutger - 23.12.2013

As far as I have seen in pawn, you cannot do more than one ; (semi-colon) per line. Add them to separated lines or put "," between them and add only ; to the end.

Not 100% sure.


Re: Help solving some errors - iPlaySAMPalot - 23.12.2013

Quote:
Originally Posted by TheOriginal1337
Посмотреть сообщение
Show more lines above and under line 10217 and we'll be able to help.
Код:
	PlayerInfo[playerid][pGangWarn] = 0; CurrentMoney[playerid] = 0; UsedFind[playerid] = 0; PlayerInfo[playerid][pTriageTime] = 0;
	PlayerInfo[playerid][pCigar] = 0; PlayerInfo[playerid][pSprunk] = 0; PlayerInfo[playerid][pSpraycan] = 0;
	CP[playerid] = 0; Robbed[playerid] = 0; SpawnChange[playerid] = 1; PlayerInfo[playerid][pPot] = 0;
	RobbedTime[playerid] = 0; MoneyMessage[playerid] = 0; Condom[playerid] = 0; PlayerInfo[playerid][pCrack] = 0;
	STDPlayer[playerid] = 0; SexOffer[playerid] = 999; SexPrice[playerid] = 0; PlayerInfo[playerid][pC4] = 0; PlayerInfo[playerid][pAdmin] = 0;
	RepairOffer[playerid] = 999; RepairPrice[playerid] = 0; RepairCar[playerid] = 0; PlayerInfo[playerid][pHelper] = 0;
	TalkingLive[playerid] = INVALID_PLAYER_ID; LiveOffer[playerid] = 999; TakingLesson[playerid] = 0;
Those are some lines around them


Quote:
Originally Posted by Hansrutger
Посмотреть сообщение
As far as I have seen in pawn, you cannot do more than one ; (semi-colon) per line. Add them to separated lines or put "," between them and add only ; to the end.

Not 100% sure.
I dont think thats the problem because the lines around that specific line are all alike and they have no errors. Its just that one.


Re: Help solving some errors - HavingGood - 23.12.2013

A view in this way:

Код:
PlayerInfo[playerid][pGangWarn] = 0;
CurrentMoney[playerid] = 0;
UsedFind[playerid] = 0;
PlayerInfo[playerid][pTriageTime] = 0;
PlayerInfo[playerid][pCigar] = 0;
PlayerInfo[playerid][pSprunk] = 0;
PlayerInfo[playerid][pSpraycan] = 0;
CP[playerid] = 0;
Robbed[playerid] = 0;
SpawnChange[playerid] = 1;
PlayerInfo[playerid][pPot] = 0;
RobbedTime[playerid] = 0;
MoneyMessage[playerid] = 0;
Condom[playerid] = 0;
PlayerInfo[playerid][pCrack] = 0;
STDPlayer[playerid] = 0;
SexOffer[playerid] = 999;
SexPrice[playerid] = 0;
PlayerInfo[playerid][pC4] = 0;
PlayerInfo[playerid][pAdmin] = 0;
RepairOffer[playerid] = 999;
RepairPrice[playerid] = 0;
RepairCar[playerid] = 0;
PlayerInfo[playerid][pHelper] = 0;
TalkingLive[playerid] = INVALID_PLAYER_ID;
LiveOffer[playerid] = 999;
TakingLesson[playerid] = 0;
And show me errors


Re: Help solving some errors - iPlaySAMPalot - 23.12.2013

Quote:
Originally Posted by HavingGood
Посмотреть сообщение
A view in this way:

Код:
PlayerInfo[playerid][pGangWarn] = 0;
CurrentMoney[playerid] = 0;
UsedFind[playerid] = 0;
PlayerInfo[playerid][pTriageTime] = 0;
PlayerInfo[playerid][pCigar] = 0;
PlayerInfo[playerid][pSprunk] = 0;
PlayerInfo[playerid][pSpraycan] = 0;
CP[playerid] = 0;
Robbed[playerid] = 0;
SpawnChange[playerid] = 1;
PlayerInfo[playerid][pPot] = 0;
RobbedTime[playerid] = 0;
MoneyMessage[playerid] = 0;
Condom[playerid] = 0;
PlayerInfo[playerid][pCrack] = 0;
STDPlayer[playerid] = 0;
SexOffer[playerid] = 999;
SexPrice[playerid] = 0;
PlayerInfo[playerid][pC4] = 0;
PlayerInfo[playerid][pAdmin] = 0;
RepairOffer[playerid] = 999;
RepairPrice[playerid] = 0;
RepairCar[playerid] = 0;
PlayerInfo[playerid][pHelper] = 0;
TalkingLive[playerid] = INVALID_PLAYER_ID;
LiveOffer[playerid] = 999;
TakingLesson[playerid] = 0;
And show me errors
These are the errors

Код:
C:\Users\Computer\Desktop\--\gamemodes\script.pwn(10217) : error 028: invalid subscript (not an array or too many subscripts): "CP"
C:\Users\Computer\Desktop\--\gamemodes\script.pwn(10217) : warning 215: expression has no effect
C:\Users\Computer\Desktop\--\gamemodes\script.pwn(10217) : error 001: expected token: ";", but found "]"
C:\Users\Computer\Desktop\--\gamemodes\script.pwn(10217) : error 029: invalid expression, assumed zero
C:\Users\Computer\Desktop\--\gamemodes\script.pwn(10217) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reallyyy need this fixed, Been on this problem for a bit, Thanks.


Re: Help solving some errors - HavingGood - 23.12.2013

The problem is here: CP[playerid] = 0;

Show me what is responsible for this function: CP


Re: Help solving some errors - iPlaySAMPalot - 23.12.2013

Quote:
Originally Posted by HavingGood
Посмотреть сообщение
The problem is here: CP[playerid] = 0;

Show me what is responsible for this function: CP
Well I got this at the top of my script

Код:
new cpid[32];
enum Business
{
	CP,
	Text3D:bLabel,
	Cost,
	Payout,
	bName[128],
}
Could it be what you need?


Re: Help solving some errors - TheOriginal1337 - 23.12.2013

Try to remove the "," after bName.


Re: Help solving some errors - HavingGood - 23.12.2013

Код:
new cpid[40];
enum Business
{
	CP,
	Text3D:bLabel,
	Cost,
	Payout,
	bName[128]
}
or

Код:
new cpid[50];
enum Business
{
	CP[20],
	Text3D:bLabel,
	Cost,
	Payout,
	bName[128]
}

If the problem will continue do so:

Код:
if (!CP[playerid])
CP[playerid] = 0;