help error 029: invalid expression, assumed zero
#1

Код:
C:\Users\memek\Desktop\server\sc mod\gamemodes\roleplay.pwn(18649) : error 029: invalid expression, assumed zero
C:\Users\memek\Desktop\server\sc mod\gamemodes\roleplay.pwn(18649) : error 029: invalid expression, assumed zero
C:\Users\memek\Desktop\server\sc mod\gamemodes\roleplay.pwn(18649) : warning 215: expression has no effect
C:\Users\memek\Desktop\server\sc mod\gamemodes\roleplay.pwn(18649) : error 001: expected token: ";", but found "]"
C:\Users\memek\Desktop\server\sc mod\gamemodes\roleplay.pwn(18649) : fatal error 107: too many error messages on one line

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


4 Errors.
what's wrong with this code?

Код:
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) == CJOB_TAXI && JOB_TAXI[playerid] != 1)
        {
            SendClientMessage(playerid, -1, "You are not a t!");
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
Reply
#2

Are you sure CJOB_TAXI is the vehicle ID? Also, you need to post more lines above it. And which line is 18649?
Reply
#3

Quote:
Originally Posted by Ritzy
Посмотреть сообщение
Are you sure CJOB_TAXI is the vehicle ID? Also, you need to post more lines above it. And which line is 18649?
yes i added this
Код:
new CJOB_TAXI;
and
Код:
CJOB_TAXI = AddStaticVehicle(420, 1729.787597, -1858.408569, 13.204060, -90.427207, -1, -1, -1 );
this line 18649
Код:
		if(GetPlayerVehicleID(playerid) == CJOB_TAXI && JOB_TAXI[playerid] != 1)
Reply
#4

Try this under OnPlayerEnterVehicle?
Код:
GetVehicleModel(vehicleid) == 420
Edit: You can Just replace CJOB_TAXI with 410 in your code itself and give it a try
Reply
#5

Can You show us the variable JOB_TAXI?
Where it is created and where is it defined?
Reply
#6

Quote:
Originally Posted by Ritzy
Посмотреть сообщение
Try this under OnPlayerEnterVehicle?
Код:
GetVehicleModel(vehicleid) == 420
Edit: You can Just replace CJOB_TAXI with 410 in your code itself and give it a try
do you mean i should change the code?
Код:
if(GetPlayerVehicleID(playerid) == CJOB_TAXI && JOB_TAXI[playerid] != 1)
with
Код:
if(GetVehicleModel(vehicleid) == 420 && JOB_TAXI[playerid] != 1)
Reply
#7

Quote:
Originally Posted by Kraeror
Посмотреть сообщение
Can You show us the variable JOB_TAXI?
Where it is created and where is it defined?
I create a job with /createjob ingame, there are some job taxi courir smugler sorter garbage and others, and save it in mysql, all there is no problem with job, it's just that I want the vehicle like taxi can only be driven by taxi job
Reply
#8

Quote:
Originally Posted by langit
Посмотреть сообщение
do you mean i should change the code?
Код:
if(GetPlayerVehicleID(playerid) == CJOB_TAXI && JOB_TAXI[playerid] != 1)
with
Код:
if(GetVehicleModel(vehicleid) == 420 && JOB_TAXI[playerid] != 1)
Don't listen to people, which don't know what they are writing!
vehicleid is a variable defined with GetVehicleID in the code:
PHP код:
new vehicleid GetVehicleID 
Your method is correct, but can You show me the variable JOB_TAXI, where it is created and where it is defined?
Reply
#9

Quote:
Originally Posted by Kraeror
Посмотреть сообщение
Don't listen to people, which don't know what they are writing!
vehicleid is a variable defined with GetVehicleID in the code:
PHP код:
new vehicleid GetVehicleID 
Your method is correct, but can You show me the variable JOB_TAXI, where it is created and where it is defined?
Код:
CMD:createjob(playerid, params[])
{
	static
	    type,
		id = -1;

	if (PlayerData[playerid][pAdmin] < 5)
	    return SendErrorMessage(playerid, "You don't have permission to use this command.");

	if (sscanf(params, "d", type))
	    return SendSyntaxMessage(playerid, "/createjob [type]");

	if (type < 1 || type > 9)
	    return SendErrorMessage(playerid, "Invalid type specified. Types range from 1 to 9.");

	id = Job_Create(playerid, type);

	if (id == -1)
	    return SendErrorMessage(playerid, "The server has reached the limit for jobs.");

	SendServerMessage(playerid, "You have successfully created job ID: %d.", id);
	return 1;
}
Reply
#10

Quote:
Originally Posted by langit
Посмотреть сообщение
Код:
CMD:createjob(playerid, params[])
{
	static
	    type,
		id = -1;

	if (PlayerData[playerid][pAdmin] < 5)
	    return SendErrorMessage(playerid, "You don't have permission to use this command.");

	if (sscanf(params, "d", type))
	    return SendSyntaxMessage(playerid, "/createjob [type]");

	if (type < 1 || type > 9)
	    return SendErrorMessage(playerid, "Invalid type specified. Types range from 1 to 9.");

	id = Job_Create(playerid, type);

	if (id == -1)
	    return SendErrorMessage(playerid, "The server has reached the limit for jobs.");

	SendServerMessage(playerid, "You have successfully created job ID: %d.", id);
	return 1;
}
I mean where is created and defined the VARIABLE JOB_TAXI
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)