Lock system !
#1

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


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(modelidFloat:xFloat:yFloat:zFloat:rxFloat:ryFloat:rzworldid = -1interiorid = -1playerid = -1Float:streamdistance 200.0);
native DestroyDynamicObject(objectid);
native IsValidDynamicObject(objectid);
native SetDynamicObjectPos(objectidFloat:xFloat:yFloat:z);
native GetDynamicObjectPos(objectid, &Float:x, &Float:y, &Float:z);
native SetDynamicObjectRot(objectidFloat:rxFloat:ryFloat:rz);
native GetDynamicObjectRot(objectid, &Float:rx, &Float:ry, &Float:rz);
native MoveDynamicObject(objectidFloat:xFloat:yFloat:zFloat:speedFloat:rx = -1000.0Float:ry = -1000.0Float:rz = -1000.0);
native StopDynamicObject(objectid);
native IsDynamicObjectMoving(objectid);
native AttachCameraToDynamicObject(playeridobjectid);
native AttachDynamicObjectToVehicle(objectidvehicleidFloat:offsetxFloat:offsetyFloat:offsetzFloat:rxFloat:ryFloat:rz);
native EditDynamicObject(playeridobjectid);
native GetDynamicObjectMaterial(objectidmaterialindex, &modelidtxdname[], texturename[], &materialcolormaxtxdname sizeof txdnamemaxtexturename sizeof texturename);
native SetDynamicObjectMaterial(objectidmaterialindexmodelidtxdname[], texturename[], materialcolor 0);
native GetDynamicObjectMaterialText(objectidmaterialindextext[], &materialsizefontface[], &fontsize, &bold, &fontcolor, &backcolor, &textalignmentmaxtext sizeof textmaxfontface sizeof fontface);
native SetDynamicObjectMaterialText(objectidmaterialindex, const text[], materialsize OBJECT_MATERIAL_SIZE_256x128, const fontface[] = "Arial"fontsize 24bold 1fontcolor 0xFFFFFFFFbackcolor 0textalignment 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(playeridclassid)
{
    switch (
classid) {
        case 
0:
        {
        
gTeam[playerid] = TEAM_MAFIASetPlayerTeam(playerid,2);
        
SetPlayerColor(playerid,MAFIA_COLOUR);
        
GameTextForPlayer(playerid"~r~Natisni Spawn za da se vkluchish v otbor Mafia"23004);
        
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(playerid269.8826 );//The Facing Angle
        
}
        case 
1:
        {
        
gTeam[playerid] = TEAM_SWATSetPlayerTeam(playerid,1);
        
SetPlayerColor(playerid,SWAT_COLOUR); // Blue
        
GameTextForPlayer(playerid"~b~Natisni Spawn za da se vkluchish v otbor S.W.A.T"23004);
        
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(playeridreason)
{
   new
        
string[64],
        
name[MAX_PLAYER_NAME];
   
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
   switch(
reason)
    {
        case 
0format(string,sizeof string,"%s left the server. (Timed out)",name);
        case 
1format(string,sizeof string,"%s left the server. (leftna po sobsvetno jelanie)",name);
        case 
2format(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(playeridPlayerNamesizeof(PlayerName));
 
format(stringsizeof(string), "%s veche si jiv kopele!"PlayerName);
 
SendClientMessageToAll(0xFFFFFFFFstring);
 return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    if(
killerid != INVALID_PLAYER_IDSetPlayerScore(killeridGetPlayerScore(killerid) + 1);
    
GivePlayerMoney(killerid500);
    return 
1;
}
public 
OnVehicleSpawn(vehicleid)
{
    return 
1;
}
public 
OnVehicleDeath(vehicleidkillerid)
{
    return 
1;
}
public 
OnPlayerText(playeridtext[])
{
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/help"cmdtexttrue10) == 0)
    {
  
SendClientMessage(playerid0x33AA33AA"/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,251577.1999500,-1637.4000200,14.0000000))
      {
            
MoveObject(gate,1577.30005,-1639.5,14,2);
            
SetTimer("timergateclose",4000,0);
            
SendClientMessage(playeridBLUE"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(playeridvehicleidispassenger)
{
 new 
string[128];
 
format(stringsizeof(string), "Ti se kachvash v Trabant ! ",vehicleid);
 
SendClientMessage(playerid0xFF0000FFstring);
 return 
1;
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
 new 
string[128];
 
format(stringsizeof(string), "Ti uspeshno izleze ot Trabant ! ",vehicleid);
 
SendClientMessage(playerid0xFF0000FFstring);
 return 
1;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
        if(
newstate == 2)
        {
            new 
CarCheck GetPlayerVehicleID(playerid);
            if(
CarCheck == Cars[Swat] )
            {
                if(
gTeam[playerid] != TEAM_SWAT)
                {
                    
RemovePlayerFromVehicle(playerid);
                    
SendClientMessage(playeridCOLOR_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(playeridCOLOR_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(playeridobjectid)
{
return 
1;
}
public 
OnPlayerPickUpPickup(playeridpickupid)
{
 if(
pickupid == healthpickup)
        {
            
SetPlayerHealth(playerid100);
            
GivePlayerWeapon(playerid2415000);
            
GivePlayerWeapon(playerid2615000);
            
GivePlayerWeapon(playerid3215000);
            
GivePlayerWeapon(playerid3115000);
            
GivePlayerWeapon(playerid3415000);
            
SetPlayerSkillLevel(playerid21000);
            
SetPlayerSkillLevel(playerid41000);
            
SetPlayerSkillLevel(playerid71000);
            
SetPlayerSkillLevel(playerid91000);
            
SetPlayerSkillLevel(playerid101000);
            return 
1;
        }
        if(
pickupid == armorpickup)
        {
             
SetPlayerArmour(playerid100);
            
GivePlayerWeapon(playerid2415000);
            
GivePlayerWeapon(playerid2615000);
            
GivePlayerWeapon(playerid3215000);
            
GivePlayerWeapon(playerid3115000);
            
GivePlayerWeapon(playerid3415000);
            
SetPlayerSkillLevel(playerid21000);
            
SetPlayerSkillLevel(playerid41000);
            
SetPlayerSkillLevel(playerid71000);
            
SetPlayerSkillLevel(playerid91000);
            
SetPlayerSkillLevel(playerid101000);
        }
        return 
1;
}
public 
OnVehicleMod(playeridvehicleidcomponentid)
{
    return 
1;
}
public 
OnVehiclePaintjob(playeridvehicleidpaintjobid)
{
    return 
1;
}
public 
OnVehicleRespray(playeridvehicleidcolor1color2)
{
    return 
1;
}
public 
OnPlayerSelectedMenuRow(playeridrow)
{
    return 
1;
}
public 
OnPlayerExitedMenu(playerid)
{
    return 
1;
}
public 
OnPlayerInteriorChange(playeridnewinterioridoldinteriorid)
{
    return 
1;
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    return 
1;
}
public 
OnRconLoginAttempt(ip[], password[], success)
{
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    return 
1;
}
public 
OnPlayerStreamIn(playeridforplayerid)
{
    return 
1;
}
public 
OnPlayerStreamOut(playeridforplayerid)
{
    return 
1;
}
public 
OnVehicleStreamIn(vehicleidforplayerid)
{
    return 
1;
}
public 
OnVehicleStreamOut(vehicleidforplayerid)
{
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    return 
1;
}
public 
OnPlayerClickPlayer(playeridclickedplayeridsource)
{
    return 
1;
}
forward timergateclose ();
public 
timergateclose ()
{
      
MoveObject(gate,1577.1999500,-1637.4000200,14.0000000,2);

Reply


Messages In This Thread
Lock system ! - by JoroApostolov - 10.02.2013, 17:57

Forum Jump:


Users browsing this thread: 1 Guest(s)