10.02.2013, 17:57
MY car lock system is not working but it doesn't showing me any errors to HELP!
This is my full gamemod script i am working in pawno from 1 day please don't be rude
This is my full gamemod script i am working in pawno from 1 day please don't be rude
PHP код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_RED 0xFF0000AA
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_REPORT 0xFFCC66AA
#define COLOR_GRAY 0x999999AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_GREEN 00FF00
#define COLOR_LIME 0x10F441AA
#define COLOR_BLUE 0x0000BBAA
#define TEAM_SWAT 1
#define TEAM_MAFIA 2
#define MAFIA_COLOUR 0xFF0000AA
#define SWAT_COLOUR 0x0000BBAA
#define SetPlayerToTeamColour
new gTeam[MAX_PLAYERS];
new gate;
new pClass[MAX_PLAYERS];
new healthpickup;
new armorpickup;
forward timergateclose ();
forward timerbarrierclose ();
enum TeamCars
{
Swat,
Mafia
}
new Cars[TeamCars];
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Welcome to 7");
print("----------------------------------\n");
}
#define COLOR_YELLOW 0xFFFF00AA
#define BLUE 0x0000BBAA
#define COLOR_RED 0xFF0000AA
#define STREAMER_TYPE_OBJECT (0)
#define STREAMER_TYPE_PICKUP (1)
#define STREAMER_TYPE_CP (2)
#define STREAMER_TYPE_RACE_CP (3)
#define STREAMER_TYPE_MAP_ICON (4)
#define STREAMER_TYPE_3D_TEXT_LABEL (5)
#define STREAMER_TYPE_AREA (6)
#define STREAMER_AREA_TYPE_CIRCLE (0)
#define STREAMER_AREA_TYPE_RECTANGLE (1)
#define STREAMER_AREA_TYPE_SPHERE (2)
#define STREAMER_AREA_TYPE_CUBE (3)
#define STREAMER_AREA_TYPE_POLYGON (4)
#define STREAMER_OBJECT_TYPE_GLOBAL (0)
#define STREAMER_OBJECT_TYPE_PLAYER (1)
#define STREAMER_OBJECT_TYPE_DYNAMIC (2)
native CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0);
native DestroyDynamicObject(objectid);
native IsValidDynamicObject(objectid);
native SetDynamicObjectPos(objectid, Float:x, Float:y, Float:z);
native GetDynamicObjectPos(objectid, &Float:x, &Float:y, &Float:z);
native SetDynamicObjectRot(objectid, Float:rx, Float:ry, Float:rz);
native GetDynamicObjectRot(objectid, &Float:rx, &Float:ry, &Float:rz);
native MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed, Float:rx = -1000.0, Float:ry = -1000.0, Float:rz = -1000.0);
native StopDynamicObject(objectid);
native IsDynamicObjectMoving(objectid);
native AttachCameraToDynamicObject(playerid, objectid);
native AttachDynamicObjectToVehicle(objectid, vehicleid, Float:offsetx, Float:offsety, Float:offsetz, Float:rx, Float:ry, Float:rz);
native EditDynamicObject(playerid, objectid);
native GetDynamicObjectMaterial(objectid, materialindex, &modelid, txdname[], texturename[], &materialcolor, maxtxdname = sizeof txdname, maxtexturename = sizeof texturename);
native SetDynamicObjectMaterial(objectid, materialindex, modelid, txdname[], texturename[], materialcolor = 0);
native GetDynamicObjectMaterialText(objectid, materialindex, text[], &materialsize, fontface[], &fontsize, &bold, &fontcolor, &backcolor, &textalignment, maxtext = sizeof text, maxfontface = sizeof fontface);
native SetDynamicObjectMaterialText(objectid, materialindex, const text[], materialsize = OBJECT_MATERIAL_SIZE_256x128, const fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
native DestroyAllDynamicObjects();
native CountDynamicObjects();
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Test Server");
//class
AddPlayerClass(294,1368.5717,-1661.4828,13.3828,269.5685,0,0,0,0,0,0);//
AddPlayerClass(285,1583.4480,-1635.3458,13.3905,358.9450,0,0,0,0,0,0); //
//Vehicle
Cars[Swat] = AddStaticVehicle(427,1583.0874,-1710.1829,6.0231,0.0001,0,1); //
Cars[Swat] = AddStaticVehicle(427,1578.5234,-1710.3124,6.0224,0.4921,0,1); //
Cars[Swat] = AddStaticVehicle(428,1574.8291,-1710.3505,6.0155,359.7744,4,75); //
Cars[Swat] = AddStaticVehicle(428,1570.5959,-1710.3656,6.0153,1.2025,4,75); //
Cars[Swat] = AddStaticVehicle(433,1559.0056,-1711.6957,6.3278,0.2219,43,0); //
Cars[Swat] = AddStaticVehicle(433,1564.9625,-1711.7024,6.3439,359.9886,43,0); //
Cars[Swat] = AddStaticVehicle(470,1528.7904,-1688.1058,5.8802,90.3412,43,0); //
Cars[Swat] = AddStaticVehicle(470,1528.7455,-1684.0853,5.8828,90.0202,43,0); //
Cars[Swat] = AddStaticVehicle(523,1543.3903,-1683.1436,5.4590,269.8143,0,0); //
Cars[Swat] = AddStaticVehicle(523,1547.2030,-1682.9921,5.4547,270.1794,0,0); //
Cars[Swat] = AddStaticVehicle(523,1547.3658,-1685.6556,5.4564,271.8244,0,0); //
Cars[Swat] = AddStaticVehicle(523,1543.5668,-1685.8221,5.4513,273.1528,0,0); //
Cars[Swat] = AddStaticVehicle(528,1544.8860,-1680.2637,5.9345,270.6208,0,0); //
Cars[Swat] = AddStaticVehicle(528,1544.8849,-1676.1425,5.9347,269.4485,0,0); //
Cars[Swat] = AddStaticVehicle(596,1539.0107,-1644.8488,5.6110,359.3278,0,1); //
Cars[Swat] = AddStaticVehicle(596,1534.9407,-1644.8158,5.6132,358.7981,0,1); //
Cars[Swat] = AddStaticVehicle(596,1531.0629,-1644.7920,5.6133,359.3195,0,1); //
Cars[Swat] = AddStaticVehicle(596,1526.7490,-1644.7454,5.6177,0.3282,0,1); // SWAT
//Objects
armorpickup = CreatePickup(1580.0232,-1635.3612,13.5607,102.9726,-1);
healthpickup = CreatePickup(1580.0232,-1635.3612,13.5607,102.9726,-1);
gate = CreateObject(3062,1577.1999500,-1637.4000200,14.0000000,0.0000000,0.0000000,90.0000000);
CreateObject(970,1544.5999800,-1621.9000200,13.1000000,0.0000000,0.0000000,90.0000000); //object(fencesmallb) (1)
CreateObject(970,1544.5999800,-1619.5999800,13.1000000,0.0000000,0.0000000,90.0000000); //object(fencesmallb) (2)
CreateObject(970,1544.5000000,-1634.8000500,13.1000000,0.0000000,0.0000000,90.0000000); //object(fencesmallb) (3)
CreateObject(970,1544.5000000,-1636.6999500,14.2000000,0.0000000,0.0000000,90.0000000); //object(fencesmallb) (4)
CreateObject(3034,1579.4000200,-1632.8000500,14.3000000,0.0000000,0.0000000,180.0000000); //object(bd_window) (1)
CreateObject(3034,1582.1999500,-1635.1999500,14.5000000,0.0000000,0.0000000,90.0000000); //object(bd_window) (2)
CreateObject(8657,1373.0999800,-1632.6999500,13.6000000,0.0000000,0.0000000,90.0000000); //object(shbbyhswall10_lvs) (1)
CreateObject(8657,1373.0000000,-1663.6999500,13.6000000,0.0000000,0.0000000,90.0000000); //object(shbbyhswall10_lvs) (2)
CreateObject(970,1394.4000200,-1653.9000200,13.1000000,0.0000000,0.0000000,90.0000000); //object(fencesmallb) (5)
CreateObject(970,1394.5999800,-1646.5000000,12.9000000,0.0000000,0.0000000,90.0000000); //object(fencesmallb) (6)
return 1;
}
public OnGameModeExit ()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
switch (classid) {
case 0:
{
gTeam[playerid] = TEAM_MAFIA; SetPlayerTeam(playerid,2);
SetPlayerColor(playerid,MAFIA_COLOUR);
GameTextForPlayer(playerid, "~r~Natisni Spawn za da se vkluchish v otbor Mafia", 2300, 4);
SetPlayerPos(playerid,1177.4351,-2036.8755,69.1484);//The Place postion
SetPlayerCameraLookAt(playerid,1177.4351,-2036.8755,69.1484);//Camera Look at the player
SetPlayerCameraPos(playerid,1180.2025,-2037.3118,69.0078);//Camera Postiion
SetPlayerFacingAngle(playerid, 269.8826 );//The Facing Angle
}
case 1:
{
gTeam[playerid] = TEAM_SWAT; SetPlayerTeam(playerid,1);
SetPlayerColor(playerid,SWAT_COLOUR); // Blue
GameTextForPlayer(playerid, "~b~Natisni Spawn za da se vkluchish v otbor S.W.A.T", 2300, 4);
SetPlayerPos(playerid,1177.4351,-2036.8755,69.1484);//The Place postion
SetPlayerCameraLookAt(playerid,1177.4351,-2036.8755,69.1484);//Camera Look at the player
SetPlayerCameraPos(playerid,1180.2025,-2037.3118,69.0078);//Camera Postiion
SetPlayerFacingAngle(playerid,269.8826 );//The Facing Angle
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new
string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
case 1: format(string,sizeof string,"%s left the server. (leftna po sobsvetno jelanie)",name);
case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
}
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}
public OnPlayerSpawn(playerid)
{
new PlayerName[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s veche si jiv kopele!", PlayerName);
SendClientMessageToAll(0xFFFFFFFF, string);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
GivePlayerMoney(killerid, 500);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0x33AA33AA, "/openswat");
return 1;
}
if(strcmp(cmdtext,"/openswat",true)==0)
{
if(gTeam[playerid] != TEAM_SWAT)
{
SendClientMessage(playerid,0x0000BBAA,"Tazi Vrata Moje da se izpolzva samo ot igrachi , koito sa v otbor S.W.A.T !");
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,25, 1577.1999500,-1637.4000200,14.0000000))
{
MoveObject(gate,1577.30005,-1639.5,14,2);
SetTimer("timergateclose",4000,0);
SendClientMessage(playerid, BLUE, "Ti otvori vratata na S.W.A.T ! Tq shte se zatvori sled 4 secundi! ");
}
else
{
SendClientMessage(playerid,BLUE,"Tvurde si dalech ot vratata na S.W.A.T !");
}
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
format(string, sizeof(string), "Ti se kachvash v Trabant ! ",vehicleid);
SendClientMessage(playerid, 0xFF0000FF, string);
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
new string[128];
format(string, sizeof(string), "Ti uspeshno izleze ot Trabant ! ",vehicleid);
SendClientMessage(playerid, 0xFF0000FF, string);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == Cars[Swat] )
{
if(gTeam[playerid] != TEAM_SWAT)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "Ne mojesh da vlezeh v kola na otbor S.W.A.T!");
return 1;
}
}
if(CarCheck == Cars[Mafia] )
{
if(gTeam[playerid] != TEAM_MAFIA)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "Ne mojesh da vlezesh v kola na otbor Mafia!");
return 1;
}
}
return 1;
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
SetPlayerToTeamColour(playerid);
{
if(gTeam[playerid] == TEAM_MAFIA)
{
SetPlayerColor(playerid,MAFIA_COLOUR); //Red
}
if(gTeam[playerid] == TEAM_SWAT)
{
SetPlayerColor(playerid,SWAT_COLOUR); // Blue
}
}
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == healthpickup)
{
SetPlayerHealth(playerid, 100);
GivePlayerWeapon(playerid, 24, 15000);
GivePlayerWeapon(playerid, 26, 15000);
GivePlayerWeapon(playerid, 32, 15000);
GivePlayerWeapon(playerid, 31, 15000);
GivePlayerWeapon(playerid, 34, 15000);
SetPlayerSkillLevel(playerid, 2, 1000);
SetPlayerSkillLevel(playerid, 4, 1000);
SetPlayerSkillLevel(playerid, 7, 1000);
SetPlayerSkillLevel(playerid, 9, 1000);
SetPlayerSkillLevel(playerid, 10, 1000);
return 1;
}
if(pickupid == armorpickup)
{
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 24, 15000);
GivePlayerWeapon(playerid, 26, 15000);
GivePlayerWeapon(playerid, 32, 15000);
GivePlayerWeapon(playerid, 31, 15000);
GivePlayerWeapon(playerid, 34, 15000);
SetPlayerSkillLevel(playerid, 2, 1000);
SetPlayerSkillLevel(playerid, 4, 1000);
SetPlayerSkillLevel(playerid, 7, 1000);
SetPlayerSkillLevel(playerid, 9, 1000);
SetPlayerSkillLevel(playerid, 10, 1000);
}
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
forward timergateclose ();
public timergateclose ()
{
MoveObject(gate,1577.1999500,-1637.4000200,14.0000000,2);
}