SA-MP Forums Archive
Error 029 - 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 029 (/showthread.php?tid=571892)



Error 029 - ChuckyBabe - 23.04.2015

The error code

PHP код:
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\replace\Irish Verse\gamemodes\IVRP.pwn(59742) : error 029invalid expressionassumed zero
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
1 Error

That line

Код:
if(IsKeyJustDown(KEY_YES, newkeys, oldkeys)) {
        if(GetPVarInt(playerid, "PBM") > 0) {
            SendClientMessage(playerid, COLOR_WHITE, "You can't do this while being in a arena!");
            return 1;
        }
        if(PlayerCuffed[playerid] >= 1) {
            SendClientMessage(playerid, COLOR_WHITE, "You can't do this right now.");
            return 1;
        }
        if(PlayerInfo[playerid][pJailed] > 0) {
            SendClientMessage(playerid, COLOR_WHITE, "You can't do this right now.");
            return 1;
        }

        new string[128];
        for(new i = 0; i < sizeof(DDoorsInfo); i++) {
            if(IsPlayerInRangeOfPoint(playerid,3.0,DDoorsInfo[i][ddExteriorX], DDoorsInfo[i][ddExteriorY], DDoorsInfo[i][ddExteriorZ]) && PlayerInfo[playerid][pVW] == DDoorsInfo[i][ddExteriorVW]) {
                if(DDoorsInfo[i][ddVIP] > 0 && PlayerInfo[playerid][pDonator] < DDoorsInfo[i][ddVIP]) {
                    SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, you're not a high enough Donator level.");
                    else
            		nasavip[playerid] = 1;
                    return 1;
                }
The red colored code represents the line of the error. This code is placed on 'OnPlayerKeyStateChange' +1 Rep!


Re: Error 029 - [XST]O_x - 23.04.2015

replace this line:
pawn Код:
if(DDoorsInfo[i][ddVIP] > 0 && PlayerInfo[playerid][pDonator] < DDoorsInfo[i][ddVIP]) {
with this:
pawn Код:
if(DDoorsInfo[i][ddVIP] > 0 && PlayerInfo[playerid][pDonator] < DDoorsInfo[i][ddVIP])



Re: Error 029 - ChuckyBabe - 23.04.2015

4 Errors pop out..

Код:
C:\Users\Windows7\Desktop\Microsoft Corporation ©\replace\Irish Verse\gamemodes\IVRP.pwn(59821) : error 017: undefined symbol "string"
C:\Users\Windows7\Desktop\Microsoft Corporation ©\replace\Irish Verse\gamemodes\IVRP.pwn(59821) : error 017: undefined symbol "string"
C:\Users\Windows7\Desktop\Microsoft Corporation ©\replace\Irish Verse\gamemodes\IVRP.pwn(59821) : error 029: invalid expression, assumed zero
C:\Users\Windows7\Desktop\Microsoft Corporation ©\replace\Irish Verse\gamemodes\IVRP.pwn(59821) : fatal error 107: too many error messages on one line

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


4 Errors.
That lines.

Код:
for(new i = 0; i < sizeof(ApartmentInfo); i++) // <------Apartment
		{
			if (IsPlayerInRangeOfPoint(playerid, 3,ApartmentInfo[i][sEnterx], ApartmentInfo[i][sEntery], ApartmentInfo[i][sEnterz]))
			{
			    GetPlayerName(playerid, plname, sizeof(plname));
				if(ApartmentInfo[i][sLocked] == 0|| strcmp(ApartmentInfo[i][sOwner], plname, false ) == 0)
				{
                    format(string, sizeof(string), "* %s has entered their apartment.", GetPlayerNameEx(playerid));
                    ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					SetPlayerInterior(playerid,ApartmentInfo[i][sInt]); SetPlayerVirtualWorld(playerid,ApartmentInfo[i][sWorld]);
					SetPlayerPos(playerid,ApartmentInfo[i][sExitx],ApartmentInfo[i][sExity],ApartmentInfo[i][sExitz]);
					InApartment[playerid] = i;
				}
				else
				{
					GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
					return 1;
				}
}
		}



Re: Error 029 - [XST]O_x - 23.04.2015

The compiler doesn't know what 'string' is. You didn't define it probably.
Add this to your code:
Код:
new string[64];



Re: Error 029 - Sawalha - 23.04.2015

you didn't add a bracket after the "else"
pawn Код:
if(DDoorsInfo[i][ddVIP] > 0 && PlayerInfo[playerid][pDonator] < DDoorsInfo[i][ddVIP]) {
                    SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, you're not a high enough Donator level.");
                    else {
                    nasavip[playerid] = 1;
                    return 1;
                  }
                }



Re: Error 029 - ChuckyBabe - 23.04.2015

I got this.

Код:
C:\Users\Windows7\Desktop\Microsoft Corporation ©\replace\Irish Verse\gamemodes\IVRP.pwn(60260) : warning 209: function "OnPlayerKeyStateChange" should return a value
C:\Users\Windows7\Desktop\Microsoft Corporation ©\replace\Irish Verse\gamemodes\IVRP.pwn(60261) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
That lines.

Код:
// Shamal
        else if(InsideShamal[playerid] != INVALID_VEHICLE_ID && IsPlayerInRangeOfPoint(playerid,3,2.509036, 23.118730, 1199.593750)) {
            format(string, sizeof(string), "* %s exits the Shamal airplane.", GetPlayerNameEx(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

            if(InsideShamal[playerid] == INVALID_VEHICLE_ID || GetVehicleModel(InsideShamal[playerid]) != 519) {
                PlayerInfo[playerid][pAGuns][GetWeaponSlot(46)] = 46;
                GivePlayerValidWeapon(playerid, 46, 60000);
                SetPlayerPos(playerid, 0.000000, 0.000000, 420.000000);
            }
            else {
                new Float:X, Float:Y, Float:Z;
                GetVehiclePos(InsideShamal[playerid], X, Y, Z);
                SetPlayerPos(playerid, X-4, Y-2.3, Z);

                new Float:XB, Float:YB, Float:ZB;
                GetVehiclePos(InsideShamal[playerid], XB, YB, ZB);
                if(ZB > 50.0) {
                    PlayerInfo[playerid][pAGuns][GetWeaponSlot(46)] = 46;
                    GivePlayerValidWeapon(playerid, 46, 60000);
                }
            }

            PlayerInfo[playerid][pVW] = 0;
            SetPlayerVirtualWorld(playerid, 0);
            PlayerInfo[playerid][pInt] = 0;
            SetPlayerInterior(playerid, 0);
            InsideShamal[playerid] = INVALID_VEHICLE_ID;
        }
    }
	return 1;
}



Re: Error 029 - [XST]O_x - 23.04.2015

You have an extra closing bracket. The red one. Remove it.


Re: Error 029 - ChuckyBabe - 23.04.2015

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
You have an extra closing bracket. The red one. Remove it.
Thanks +1 REP!

Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase



Re: Error 029 - BleverCastard - 23.04.2015

You guys are idiots. If ChuckyBabe can't read what those errors are thrown at him, then he shouldn't be scripting. They cannot be explained any more simpler.


Re: Error 029 - ChuckyBabe - 23.04.2015

Quote:
Originally Posted by BleverCastard
Посмотреть сообщение
You guys are idiots. If ChuckyBabe can't read what those errors are thrown at him, then he shouldn't be scripting. They cannot be explained any more simpler.
I don't create this codes. It's scripted for me. Noob!