Errors
#1

error 001: expected token: ")", but found ".."
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Код:
if(vehicleid == ArmyVeh[0]..[19] && GetPlayerClass[playerid] == ARMY_CLASS)
	{
 		ClearAnimations(playerid);
		GameTextForPlayer(playerid,"Army Vehicle",3000,4);
	}
Reply
#2

help?
Reply
#3

What are the 2 dots doing there between [0] and [19] ?

pawn Код:
if(vehicleid == ArmyVeh[0][19] && GetPlayerClass[playerid] == ARMY_CLASS)
{
    ClearAnimations(playerid);
    GameTextForPlayer(playerid,"Army Vehicle",3000,4);
}
Reply
#4

It actually depends on your array..if the example above didn't work, and you wanna check for all the army vehicles, do this.
pawn Код:
if(GetPlayerClass[playerid] == ARMY_CLASS)
{
    for(new i; i<20; i++)//change 20 to "sizeof(ArmyVeh)" if you want it for all the Army Vehicles..
    {
        if(vehicleid == ArmyVeh[i])
        {
            ClearAnimations(playerid);
            GameTextForPlayer(playerid,"Army Vehicle",3000,4);
        }
    }
}
Reply
#5

how do i change it to sizeof(ArmyVeh)?
Reply
#6

PHP код:
if(GetPlayerClass[playerid] == ARMY_CLASS)
{
    for(new 
ii<sizeof(ArmyVeh); i++)
    {
        if(
vehicleid == ArmyVeh[i])
        {
            
ClearAnimations(playerid);
            
GameTextForPlayer(playerid,"Army Vehicle",3000,4);
        }
    }

Reply
#7

Quote:
Originally Posted by TheKnown
Посмотреть сообщение
how do i change it to sizeof(ArmyVeh)?
do this ONLY if you know what are you doing, if you wanna check for the whole array use it, if not just use the number.

Quote:
Originally Posted by KillerDVX
Посмотреть сообщение
pawn Код:
if(GetPlayerClass[playerid] == ARMY_CLASS)
{
    for(new i; i<sizeof(ArmyVeh); i++)
    {
        if(vehicleid == ArmyVeh[i])
        {
            ClearAnimations(playerid);
            GameTextForPlayer(playerid,"Army Vehicle",3000,4);
        }
    }
}
Reply
#8

Is the code right?
Код:
if(GetPlayerClass[playerid] != ARMY_CLASS)
	{
		for(new i; i<sizeof(ArmyVeh); i++)//change 20 to "sizeof(ArmyVeh)" if you want it for all the Army Vehicles..
		{
			if(vehicleid == ArmyVeh[i])
			{
				ClearAnimations(playerid);
				GameTextForPlayer(playerid,"Army Vehicle",3000,4);
			}
		}
	}
	if(GetPlayerClass[playerid] != ARMY_CLASS || GetPlayerClass[playerid] != COP_CLASS)
	{
		for(new i; i<sizeof(PDVeh); i++)//change 20 to "sizeof(ArmyVeh)" if you want it for all the Army Vehicles..
		{
			if(vehicleid == PDVeh[i])
			{
    			SendClientMessage(playerid, COLOR_RED, "Wanted Level Increased");
	    		SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+3);
	    		SetPlayerColor(playerid, COLOR_ORANGE);
	    		if(GetPlayerWantedLevel(playerid) >= 4)
	    		{
	    		    SetPlayerColor(playerid, COLOR_RED);
	    		}
			}
		}
	}
 	if(pInfo[playerid][Adminlevel] != 1)
	{
		for(new i; i<sizeof(AdminVeh); i++)//change 20 to "sizeof(ArmyVeh)" if you want it for all the Army Vehicles..
		{
			if(vehicleid == AdminVeh[i])
			{
				ClearAnimations(playerid);
				GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
			}
		}
	}
I can't enter the other cars..It says Admin Vehicle on the cars on the street
And when i enter the PDVeh as a cop i get wanted level
Reply
#9

This should work, IF the "AdminVeh" array's probably created, show me how do you create the admin cars..
Reply
#10

i fixed it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)