Help Please Error 029 PAWNO
#1

Hi There,

i was trying to script a admin vehicle to work with the admin system i use which is LuxAdmin V1.5 i did all i used to which was
Код:
new Admin_Vehicle;
Код:
Admin_Vehicle = CreateVehicle(415,1544.1481,-1659.2570,5.6624,89.9421,0,0,5000);
Код:
	if(vehicleid == Admin_Vehicle && !IsPlayerAdmin(playerid))
	{
	    ClearAnimations(playerid);
		SendClientMessage(playerid, 0xAA3333AA, "This vehicle is for admins only!");
	}
Then because i dont have a built in admin system tryed to edit to let admin players enter not just Rcon admins so did all the same apart from the end code

Код:
	if(vehicleid = Admin_Vehicle && (AccInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
		{
		ClearAnimations(playerid);
		SendClientMessage(playerid, 0xAA3333AA, "This vehicle is for admins only!");
		}
But i get this error:
Код:
C:\Users\.....\Desktop\Fas FreeRoam\filterscripts\LuxAdmin.pwn(7839) : warning 217: loose indentation
C:\Users\......\Desktop\Fas FreeRoam\filterscripts\LuxAdmin.pwn(7839) : warning 211: possibly unintended assignment
C:\Users\......\Desktop\Fas FreeRoam\filterscripts\LuxAdmin.pwn(7840) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Does anyone know what is wrong ? if you do please reply i would be most please.

Thanks
Reply
#2

if(AccInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid) && vehicleid = Admin_Vehicle)
{
ClearAnimations(playerid);
SendClientMessage(playerid, 0xAA3333AA, "This vehicle is for admins only!");
}
Reply
#3

Thank you very much for the fast reply i added it but did i add it wrong ? because i get 4errors now
Код:
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\filterscripts\LuxAdmin.pwn(7839) : warning 217: loose indentation
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\filterscripts\LuxAdmin.pwn(7839) : warning 211: possibly unintended assignment
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\filterscripts\LuxAdmin.pwn(7839) : error 022: must be lvalue (non-constant)
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\filterscripts\LuxAdmin.pwn(7839) : warning 215: expression has no effect
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\filterscripts\LuxAdmin.pwn(7839) : error 001: expected token: ";", but found ")"
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\filterscripts\LuxAdmin.pwn(7839) : error 029: invalid expression, assumed zero
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\filterscripts\LuxAdmin.pwn(7839) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#4

Can you post the whole code around the edited code?
Reply
#5

never mind i fixed it the correct code was
Код:
		if(AccInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid) && (vehicleid = Admin_Vehicle))
 		{
		ClearAnimations(playerid);
 		SendClientMessage(playerid, 0xAA3333AA, "This vehicle is for admins only!");
		}
thanks very much
Reply
#6

I didn't think that needed () xD hmmm weird, oh well.
Reply
#7

when you use 'or' and 'and' in the same condition you have to isolate them
Reply
#8

The More You Know

Aha... Thanks.
Reply
#9

kkkkk nothing
Reply
#10

No one else here spotted the single = ? When checking a value that should be equal to, you need to use 2 = signs so it should be

pawn Код:
if(vehicleid == Admin_Vehicle && (AccInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
    {
        ClearAnimations(playerid);
        SendClientMessage(playerid, 0xAA3333AA, "This vehicle is for admins only!");
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)