Error 017 - Now Warning 219.
#1

Hello there.

Problem.
Код:
(3013) : error 017: undefined symbol "vehicleid"
Code.
Код:
public IsABoat(carid)
{	new model = GetVehicleModel(vehicleid); // Line 3013.
	if(model == 472 || model == 473 || model == 493 || model == 595 || model == 484 || model == 453 || model == 452 || model == 446 || model == 454)
Anyone got the last part of this? The solution part?
Reply
#2

Just add:
pawn Код:
new v;
v = GetPlayerVehicleID(playerid);
new model = GetVehicleModel(v);
Edit: Joe Torran C's code beats mine,shorter,nicer and more efficient,but anyway,both of them works.
Reply
#3

pawn Код:
new model = GetVehicleModel(GetPlayerVehicleID(playerid));
Reply
#4

Oops I made a mistake.
At the define part of IsABoat I had carid instead of vehicleid.
Changed every carid to vehicleid now.

Though another problem pops up.

Forty-six warnings received which are all like this:
Код:
warning 219: local variable "vehicleid" shadows a variable at a preceding level.
One specific:
Код:
(3210) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
The part code where the problem is located.
Код:
public IsABike(vehicleid) // Line 3210.
{new model = GetVehicleModel(vehicleid);
	if(model == 581 || model == 509 || model == 481 || model == 462 || model == 521 || model == 463 || model == 510 || model == 522 || model == 461 || model == 448 || model == 468 || model == 586)
	{
		return 1;
	}
	return 0;
}
Reply
#5

Quote:
Originally Posted by Carvos
Oops I made a mistake.
At the define part of IsABoat I had carid instead of vehicleid.
Changed every carid to vehicleid now.

Though another problem pops up.

Forty-six warnings received which are all like this:
Код:
warning 219: local variable "vehicleid" shadows a variable at a preceding level.
One specific:
Код:
(3210) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
The part code where the problem is located.
pawn Код:
public IsABike(vehicleid) // Line 3210.
{new model = GetVehicleModel(vehicleid);
    if(model == 581 || model == 509 || model == 481 || model == 462 || model == 521 || model == 463 || model == 510 || model == 522 || model == 461 || model == 448 || model == 468 || model == 586)
    {
        return 1;
    }
    return 0;
}
Edit: Oops, I'm dearly sorry, I did quote instead of modify. Please remove this post.
Reply
#6

replace vehicleid to some other name vid
Reply
#7

I did replace every 'vehicleid' to 'vid', then changed every 'vid' to 'vehicleid'.

Код:
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(2672) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(2737) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(2859) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3012) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3021) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3030) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3039) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3048) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3057) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3066) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3075) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3084) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3093) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3102) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3111) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3120) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3129) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3138) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3147) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3156) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3210) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(3219) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(5565) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(5886) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(6240) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(6267) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(6824) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(7354) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(7511) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(7522) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(7570) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(8099) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(9172) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(9228) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(13774) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(16377) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(17190) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(20809) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(21756) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(23331) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(25593) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(43534) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(43742) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(44667) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(44882) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(44905) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(45088) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(45366) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
Mhm. Just warnings though. Anyone knows what to do?
Reply
#8

Is there a new vehicleid; at the top of your script?
Reply
#9

Quote:
Originally Posted by Joe Torran C
Is there a new vehicleid; at the top of your script?
Nope, but new vehicleid; is written below some commands.
Reply
#10

Update.

I tried to paste what you said somewhere on top of my script.
Then I got an additional error.

Код:
F:\Scripts\Divinity Gaming\gamemodes\DGRP.pwn(816) : error 021: symbol already defined: "vehicleid"
So I removed that again.

Anyone got a solution for me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)