SA-MP Forums Archive
Errors..? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Errors..? (/showthread.php?tid=529106)



Errors..? - Drago987 - 31.07.2014

Hello. So I've been trying to attach a Label Text to the LEO's when they do /assigncar. When the LEO's do /assigncar it creates a labeltext at the back of the car with his callsign and badge number, but I got these errors:
Код:
E:\Shock Roleplay 0.3z\gamemodes\BGRP.pwn(17061) : error 028: invalid subscript (not an array or too many subscripts): "Dispatch3DText"
E:\0.3z Script\gamemodes\BGRP.pwn(17061) : warning 215: expression has no effect
E:\0.3z Script\gamemodes\BGRP.pwn(17061) : error 001: expected token: ";", but found "]"
E:\0.3z Script\gamemodes\BGRP.pwn(17061) : error 029: invalid expression, assumed zero
E:\0.3z Script\gamemodes\BGRP.pwn(17061) : fatal error 107: too many error messages on one line

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


4 Errors.
pawn Код:
forward AssignDispatchCar(playerid, carnum, vehicleid);
public AssignDispatchCar(playerid, carnum, vehicleid)
{
    new rank[64], division[64], employer[64], callsign[64], string[64];
    GetPlayerFactionInfo(playerid, rank, division, employer);

    DPCar[carnum][dpCarID] = vehicleid;
    format(DPCar[carnum][dpFaction], 10, "%s", employer);
    format(DPCar[carnum][dpModel], 24, "%s", GetVehicleName(vehicleid));
    DPCar[carnum][dpOfficerID] = playerid;
    format(string, sizeof(string), "%s-%d", callsign, PlayerInfo[playerid][pBadgeNum]);
    Copcar3DText[vehicleid] = Create3DTextLabel(string, 0xC8C8C8C8, 0.0, 0.0, 0.0, 50.0, 0, 1 ); //<< Error Line
}
NOTE:I'd really apperciate it if you guys gave me the (Posx, Posy and Posz) for the label to place it in the back bumper, Like LS-RP

++ REP


Re: Errors..? - Drago987 - 31.07.2014

Anyone?


Re: Errors..? - SkRiLLeX032 - 31.07.2014

can u post line 17061


Re: Errors..? - TLN - 31.07.2014

He already did.
pawn Код:
Copcar3DText[vehicleid] = Create3DTextLabel(string, 0xC8C8C8C8, 0.0, 0.0, 0.0, 50.0, 0, 1 ); //<< Error Line



Re: Errors..? - SlimDkhili - 31.07.2014

show us where did you defined Copcar3DText


Re: Errors..? - Drago987 - 31.07.2014

Quote:
Originally Posted by SlimDkhili
Посмотреть сообщение
show us where did you defined Copcar3DText
pawn Код:
new Text3D:Copcar3DText;



Re: Errors..? - SlimDkhili - 31.07.2014

Код:
new Text3D:Copcar3DText[MAX_PLAYERS];



Re: Errors..? - SkRiLLeX032 - 31.07.2014

try this

Код:
new Text3D:Copcar3DText[MAX_PLAYERS];



Re: Errors..? - Isolated - 31.07.2014

Quote:
Originally Posted by SkRiLLeX032
Посмотреть сообщение
try this

Код:
new Text3D:Copcar3DText[MAX_PLAYERS];
The two people above, really need to learn how arrays work.

pawn Код:
new Text3D:Copcar3DText[MAX_VEHICLES];
Try that, MAX_PLAYERS = 1000, MAX_VEHICLES = 2000

In short, you're creating an array with insufficient items.


Re: Errors..? - SkRiLLeX032 - 31.07.2014

Quote:
Originally Posted by Isolated
Посмотреть сообщение
You changed nothing.

pawn Код:
new Text3D:Copcar3DText[MAX_VEHICLES];
Try that, MAX_PLAYERS = 1000, MAX_VEHICLES = 2000

In short, you're creating an array with insufficient items.
i didn't saw his post Sorry