I got an Error
#1

I want to enter several cars not on break.
I get this error

pawn Код:
C:\Users\Domenic\Desktop\Neuer Ordner\gamemodes\FunZone.pwn(1354) : error 017: undefined symbol "carid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
I've added it:

pawn Код:
#pragma tabsize 0
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_DARKBLUE 0x0000D0FF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_LIGHTBLUE 0xBBFFFFFF
#define COLOR_BLACK 0x000000FF
#define MESSAGE_MINUTES 1 // Show the message every 1 minute.
new car[21];
//new bcp[80];Will be used for admin */
new test[110];
new gate1;
new gate2;
new Wang[12];
new Meh[888];
new stuntcars[100];

#define AddVehicle
forward public OnVehicleSpwan(playerid, vehicleid);
forward SetupPlayerForClassSelection(playerid);
forward GameModeExitFunc();
forward SendPlayerFormattedText(playerid, const str[], define);
forward public SendAllFormattedText(playerid, const str[], define);
forward IsAStuntCar(carid);
public IsAStuntCar(carid)
{
if(carid >= stuntcars[0] && carid <= stuntcars[10])
{
return 1;
}
return 0;
}
I have numbered the cars:

pawn Код:
stuntcars[1]=AddStaticVehicle(506,2053.6191,-2531.4653,13.2518,267.6631,7,7); // hk
stuntcars[2]=AddStaticVehicle(451,2053.6113,-2528.3479,13.2538,270.1722,75,75); // hk
stuntcars[3]=AddStaticVehicle(451,2053.6238,-2525.2954,13.2547,269.6550,123,123); // hk
stuntcars[4]=AddStaticVehicle(506,2053.5415,-2534.8201,13.2514,268.9489,52,52); // hk
stuntcars[5]=AddStaticVehicle(522,2052.4912,-2519.8235,13.1180,241.0262,7,79); // hk
stuntcars[6]=AddStaticVehicle(522,2053.6216,-2518.5317,13.1121,212.5332,8,82); // hk
stuntcars[7]=AddStaticVehicle(522,2054.4590,-2517.6938,13.1192,220.4221,36,105); // hk
stuntcars[8]=AddStaticVehicle(522,2055.4028,-2516.6040,13.1184,233.1601,39,106); // hk
stuntcars[9]=AddStaticVehicle(522,2056.2859,-2515.4937,13.1265,227.2686,51,118); // hk
stuntcars[10]=AddStaticVehicle(522,2057.2791,-2514.4087,13.1098,203.9233,3,3); // hk
stuntcars[11]=AddStaticVehicle(522,2058.9714,-2513.9031,13.1181,186.6472,6,25); // hk
stuntcars[12]=AddStaticVehicle(522,2060.7434,-2514.2288,13.1099,174.4337,7,79); // hk
stuntcars[13]=AddStaticVehicle(522,2062.3921,-2514.0088,13.1179,179.1058,8,82); // hk....[/pwn]
das ist mein tele befehl
[pwn] if(strcmp(cmd, "/stunt4", true) == 0) { if(IsAStuntCar(carid)) { new cartype = GetPlayerVehicleID(playerid);
new State=GetPlayerState(playerid);
SetPlayerInterior(playerid,0);
{
if(State!=PLAYER_STATE_DRIVER)
{
SetPlayerPos(playerid,-2316.5,-1640.0999755859,483.39999389648);
GivePlayerWeapon(playerid, 46, 1);
}
else if(IsPlayerInVehicle(playerid, cartype) == 1)
{
new Float:h;
new veh=GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, h);
if(h < 1000.0)RepairVehicle(veh);
SetVehiclePos(cartype,-2316.5,-1640.0999755859,483.39999389648);
SetVehicleZAngle(cartype,270);
}
else
{
SetPlayerPos(playerid,-2316.5,-1640.0999755859,483.39999389648);
}
GameTextForPlayer(playerid,"[] Welcome to The Stunt arena.[]",2500,3);
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"Du befindest dich in keinem Stuntcar!");
return 1;
}

return 1;
}

whats wrong ?
Reply
#2

The script doesn't know what carid is, you need to define it.
And also, use [ pawn ] tags instead of [ pwn ]
Reply
#3

SHit post the code using [pawn] not [pwn]
may be u need to define the carid like
new carid; or new carid[MAX_PLAYERS]
idk much
Reply
#4

can u show it i dont understand what u mean... ?

bow i get this

pawn Код:
C:\Users\Domenic\Desktop\Neuer Ordner\gamemodes\FunZone.pwn(38) : warning 219: local variable "carid" shadows a variable at a preceding level
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Reply
#5

pawn Код:
new car[21]; //shouldn't it be new carid[21];
Reply
#6

now this
pawn Код:
C:\Users\Domenic\Desktop\Neuer Ordner\gamemodes\FunZone.pwn(29) : error 021: symbol already defined: "car"
C:\Users\Domenic\Desktop\Neuer Ordner\gamemodes\FunZone.pwn(1357) : error 017: undefined symbol "carid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#7

#push
Reply
#8

You need to show us the code arround the errors else we can't help you!
Reply
#9

ok lol i got it but now i got an windows error and pawno is quit oO
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)