30.07.2013, 17:22
I have a script, but it isn't quite 'finished' there are a few unfinished things and bugs, I want to add more code to the script, when I compile the code itself it's perfect, no errors, but when I add the code into my script, it says 2 errors?
That is the code I am trying to add into my script, how can I do so?
My errors:
[/PHP]
PHP код:
/*
Simple Vehicle Spawn and Destroy by WarriorEd22
*/
#include <a_samp>
#include <zcmd>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Simple Vehicle Spawn and Destroy by WarriorEd22");
print("--------------------------------------\n");
return 1;
}
//Commands / Spawn Vehicles
COMMAND:v(playerid, params[])
{
#if USE_ADMIN == true
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, C_RED, "This command will be added to this server soon. For now, try /cmds . ");
#endif
new Vehicle[50];
if(!sscanf(params, "s[50]", Vehicle))
{
new string[128], Float:Pos[4];
GetPlayerPos(playerid, Pos[0],Pos[1],Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]);
new veh = GetVehicleModelID(Vehicle);
if(veh < 400 || veh > 611) return SendClientMessage(playerid, C_RED, "This is not a valid vehicle name! Please try again ");
if(IsPlayerInAnyVehicle(playerid)) { DestroyVehicle(GetPlayerVehicleID(playerid)); }
GetXYInFrontOfPlayer(playerid, Pos[0], Pos[1], 5);
new PVeh = CreateVehicle(veh, Pos[0], Pos[1], Pos[2], Pos[3]+90, -1, -1, -1);
LinkVehicleToInterior(PVeh, GetPlayerInterior(playerid)); SetVehicleVirtualWorld(PVeh, GetPlayerVirtualWorld(playerid));
format(string, sizeof string, "You spawned a %s. ID: %i. ", aVehicleNames[veh - 400], veh);
SendClientMessage(playerid, C_GREEN, string);
} else return SendClientMessage(playerid, C_GREEN, "Usage: /v [vehiclename] ");
return 1;
}
//Stocks - Do NOT Edit ... Ignore
stock GetVehicleModelID(vehiclename[])
{
for(new i = 0; i < 211; i++)
{
if(strfind(aVehicleNames[i], vehiclename, true) != -1)
return i + 400;
}
return -1;
}
stock GetXYInFrontOfPlayer(playerid, &Float:x2, &Float:y2, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x2, y2, a);
GetPlayerFacingAngle(playerid, a);
if(GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x2 += (distance * floatsin(-a, degrees));
y2 += (distance * floatcos(-a, degrees));
}
//Vehicle Destroy
COMMAND:vdestroy(playerid, params[])
{
new testcar= GetPlayerVehicleID(playerid);
SendClientMessage(playerid, 0xFFFFFFFF, "You have deleted a car!!");
DestroyVehicle(testcar);
return 1;
}
#endif
My errors:
PHP код:
This:
[php]C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(232) : warning 201: redefinition of constant/macro (symbol "MAX_ROADBLOCKS")
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(29036) : warning 206: redundant test: constant expression is non-zero
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(97343) : warning 203: symbol is never used: "params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(97381) : warning 203: symbol is never used: "params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(97402) : warning 203: symbol is never used: "params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(98450) : warning 203: symbol is never used: "params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(103944) : warning 217: loose indentation
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(104089) : warning 217: loose indentation
C:\Users\*\Desktop\New folder (2)\pawno\include\zcmd.inc(63) : error 021: symbol already defined: "Itter_OnGameModeInit"
C:\Users\*\Desktop\New folder (2)\pawno\include\zcmd.inc(84) : error 021: symbol already defined: "OnPlayerCommandText"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(28182) : warning 204: symbol is assigned a value that is never used: "InfoBoardTimer"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(56405) : warning 204: symbol is assigned a value that is never used: "iSweeper"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.