29.03.2013, 03:28
While I am scripting /v, I got a lot of errors in this script.
Errors:
pawn Код:
CMD:v(playerid,params[])
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);
if(!strlen(tmp)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /car [ModelID/Name] [Colour1] [Colour2]") &&
SendClientMessage(playerid, orange, "Function: Will create a Car with specified Colours");
new car;
new string[128];
new colour1, colour2;
if(!IsNumeric(tmp))
car = GetVehicleModelIDFromName(tmp);
else car = strval(tmp);
if(car < 400 || car > 611) return SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model ID!");
if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
if(!IsPlayerAdmin(playerid))
EraseVeh(AccInfo[playerid][pCar]);
new LVehicleID;
new Float:X,Float:Y,Float:Z;
new Float:Angle,int1;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
int1 = GetPlayerInterior(playerid);
LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
LinkVehicleToInterior(LVehicleID,int1);
AccInfo[playerid][pCar] = LVehicleID;
format(string, sizeof(string), "%s Spawned a \"%s\" (Model:%d) Colours (%d, %d), Pos: X:%0.2f, Y:%0.2f, Z:%0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
SaveIn("CarSpawns",string);
format(string, sizeof(string), "|- You have Spawned a \"%s\" (Model: %d) with Colours: %d,%d -|", VehicleNames[car-400], car, colour1, colour2);
return SendClientMessage(playerid,LIGHTBLUE, string);
}
Код:
C:\Users\Kelvin\Desktop\Scripting\pawno\include\dutils.inc(28) : error 021: symbol already defined: "isNumeric" C:\Users\Kelvin\Desktop\Scripting\pawno\include\dutils.inc(379) : error 025: function heading differs from prototype C:\Users\Kelvin\Desktop\Scripting\pawno\include\dutils.inc(380) : error 021: symbol already defined: "strtok" C:\Users\Kelvin\Desktop\Scripting\pawno\include\dutils.inc(395) : error 047: array sizes do not match, or destination array is too small C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(6534) : error 017: undefined symbol "IsNumeric" C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(6535) : error 017: undefined symbol "GetVehicleModelIDFromName" C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(6542) : error 017: undefined symbol "EraseVeh" C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(6542) : warning 215: expression has no effect C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(6542) : error 001: expected token: ";", but found "]" C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(6542) : error 029: invalid expression, assumed zero C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(6542) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 10 Errors.