#define FILTERSCRIPT
#include <a_samp>
#tryinclude <streamer>
#if defined _streamer_included
#define CObject CreateDynamicObject
#define AObject AttachDynamicObjectToVehicle
#define DObject DestroyDynamicObject
#define VObject IsValidDynamicObject
#else
#define CObject CreateObject
#define AObject AttachObjectToVehicle
#define DObject DestroyObject
#define VObject IsValidObject
#endif
new obj[MAX_VEHICLES] = { INVALID_OBJECT_ID, ... };
public OnFilterScriptInit()
{
print("Code 2 lights loaded.");
return 1;
}
public OnFilterScriptExit()
{
for (new i = 0; i < MAX_VEHICLES; i++)
{
DObject(obj[i]);
}
print("Code 2 lights unloaded.");
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
DObject(obj[vehicleid]);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/code2", cmdtext, true, 6) == 0)
{
if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
{
return SendClientMessage(playerid, -1, "* You are not the driver!");
}
new pveh = GetPlayerVehicleID(playerid);
if (!GetVehicleModel(pveh)) return SendClientMessage(playerid, -1, "* You are not in a vehicle!");
if (VObject(obj[pveh])) return SendClientMessage(playerid, -1, "* You switched off the lights."), DObject(obj[pveh]);
switch (GetVehicleModel(pveh))
{
case 596:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, -0.379999, 0.889999, 0.000000, 0.000000, 0.000000);
}
case 597:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, -0.374999, 0.884999, 0.000000, 0.000000, 0.000000);
}
case 598:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, -0.334498, 0.933500, 0.000000, 0.000000, 0.000000);
}
case 599:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, 0.039999, 1.153999, 0.000000, 0.000000, 0.000000);
}
default:
{
return SendClientMessage(playerid, -1, "* You are not in a CODE 2 compatible police vehicle!");
}
}
return SendClientMessage(playerid, -1, "* Lights on, you are now in a CODE 2 run!");
}
return 0;
}
native AttachDynamicObjectToVehicle(objectid, vehicleid, Float:offsetx, Float:offsety, Float:offsetz, Float:rx, Float:ry, Float:rz);
#define FILTERSCRIPT #include <a_samp> #include <streamer> #if defined _streamer_included #define CObject CreateDynamicObject #define AObject AttachDynamicObjectToVehicle #define DObject DestroyDynamicObject #define VObject IsValidDynamicObject #else #define CObject CreateObject #define AObject AttachObjectToVehicle #define DObject DestroyObject #define VObject IsValidObject #endif new obj[MAX_PLAYERS] = { INVALID_OBJECT_ID, ... }; public OnFilterScriptInit() { print("Code 2 lights loaded.\n"); return 1; } public OnFilterScriptExit() { for (new i = 0; i < MAX_VEHICLES; i++) { DObject(obj[i]); } print("Code 2 lights unloaded.\n"); return 1; } public OnVehicleDeath(vehicleid, killerid) { DObject(obj[vehicleid]); return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if ((oldkeys & KEY_LOOK_RIGHT ) && !(newkeys & KEY_LOOK_RIGHT )) { if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { //return SendClientMessage(playerid, -1, "Vous n'etes pas le conducteur"); } new pveh = GetPlayerVehicleID(playerid); //if (!GetVehicleModel(pveh)) return SendClientMessage(playerid, -1, "Vous n'etes pas dans un vehicule"); //if (VObject(obj[pveh])) return SendClientMessage(playerid, -1, "Vous eteignez les gyrophares"), DObject(obj[pveh]); switch (GetVehicleModel(pveh)) { case 596: { obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AObject(obj[pveh], pveh, 0.000000, -0.379999, 0.889999, 0.000000, 0.000000, 0.000000); } case 597: { obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AObject(obj[pveh], pveh, 0.000000, -0.374999, 0.884999, 0.000000, 0.000000, 0.000000); } case 598: { obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AObject(obj[pveh], pveh, 0.000000, -0.334498, 0.933500, 0.000000, 0.000000, 0.000000); } case 599: { obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AObject(obj[pveh], pveh, 0.000000, 0.039999, 1.153999, 0.000000, 0.000000, 0.000000); } default: { //return SendClientMessage(playerid, -1, "Vous n'etes pas dans un vehicule de police"); } } //return SendClientMessage(playerid, -1, "Vous activez les gyrophares silencieux"); } return 0; }
One of the bugs we found in our server is that if playera turns it on, it takes the object from playerb.
Anyone else have that problem? |
C:\Documents and Settings\SinkopaComputers\Desktop\samp03dsvr_R2_win32\pawno\include\streamer.inc(274) : error 017: undefined symbol "IsPlayerNPC" C:\Documents and Settings\SinkopaComputers\Desktop\samp03dsvr_R2_win32\pawno\include\streamer.inc(296) : error 017: undefined symbol "IsPlayerNPC" C:\Documents and Settings\SinkopaComputers\Desktop\samp03dsvr_R2_win32\pawno\include\streamer.inc(318) : error 017: undefined symbol "IsPlayerNPC" C:\Documents and Settings\SinkopaComputers\Desktop\samp03dsvr_R2_win32\pawno\include\streamer.inc(340) : error 017: undefined symbol "IsPlayerNPC" C:\Documents and Settings\SinkopaComputers\Desktop\samp03dsvr_R2_win32\pawno\include\streamer.inc(362) : error 017: undefined symbol "IsPlayerNPC" C:\Documents and Settings\SinkopaComputers\Desktop\samp03dsvr_R2_win32\pawno\include\streamer.inc(384) : error 017: undefined symbol "IsPlayerNPC" C:\Documents and Settings\SinkopaComputers\Desktop\samp03dsvr_R2_win32\pawno\include\streamer.inc(406) : error 017: undefined symbol "IsPlayerNPC" C:\Documents and Settings\SinkopaComputers\Desktop\samp03dsvr_R2_win32\pawno\include\streamer.inc(433) : warning 202: number of arguments does not match definition C:\Documents and Settings\SinkopaComputers\Desktop\samp03dsvr_R2_win32\pawno\include\streamer.inc(434) : error 017: undefined symbol "CreatePlayer3DTextLabel" C:\Documents and Settings\SinkopaComputers\Desktop\samp03dsvr_R2_win32\pawno\include\streamer.inc(436) : error 017: undefined symbol "DeletePlayer3DTextLabel" C:\Documents and Settings\SinkopaComputers\Desktop\samp03dsvr_R2_win32\pawno\include\streamer.inc(454) : error 017: undefined symbol "UpdatePlayer3DTextLabelText" C:\Documents and Settings\SinkopaComputers\Desktop\gang wars\filterscripts\police.pwn(56) : error 017: undefined symbol "AttachDynamicObjectToVehicle" C:\Documents and Settings\SinkopaComputers\Desktop\gang wars\filterscripts\police.pwn(61) : error 017: undefined symbol "AttachDynamicObjectToVehicle" C:\Documents and Settings\SinkopaComputers\Desktop\gang wars\filterscripts\police.pwn(66) : error 017: undefined symbol "AttachDynamicObjectToVehicle" C:\Documents and Settings\SinkopaComputers\Desktop\gang wars\filterscripts\police.pwn(71) : error 017: undefined symbol "AttachDynamicObjectToVehicle" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 14 Errors.