Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define TEAM1 0
- #define TEAM2 1
- new gTeam[MAX_PLAYERS];
- new gate;
- forward SetPlayerTeamFromClass(playerid, classid);
- public OnGameModeInit()
- {
- SetGameModeText("SA-AIRLINES SECURITY DEMO :D");
- //skins,classes....
- AddPlayerClass(71, -1545.2791, -448.4932,6.0068, 231.3076, 0, 0, 0, 0, 0, 0);// security
- AddPlayerClass(29, -1545.2791, -448.4932,6.0068, 269.1425, 0, 0, 0, 0, 0, 0);//civilion
- //= lol
- gate = CreateObject(7657, -1545.6732177734, -430.65551757813, 6.7213397026062, 0, 0, 316);
- //objects
- CreateObject(2922, -1545.0002441406, -443.06915283203, 5.6424250602722, 0, 2, 222);
- //vehicles
- AddStaticVehicleEx(583,-1534.56896973,-445.33132935,5.42359400,256.00000000,-1,2,15); //Tug
- AddStaticVehicleEx(583,-1528.60351562,-450.42242432,5.41502237,255.99792480,-1,2,15); //Tug
- AddStaticVehicleEx(583,-1531.53198242,-447.91894531,5.45144415,255.99792480,-1,1,15); //Tug
- AddStaticVehicleEx(583,-1525.61035156,-453.03411865,5.40000010,255.99792480,-1,1,15); //Tug
- AddStaticVehicleEx(583,-1522.17968750,-455.51168823,5.40000010,255.99792480,-1,2,15); //Tug
- AddStaticVehicleEx(583,-1518.90283203,-457.72406006,5.40000010,255.99792480,-1,1,15); //Tug
- AddStaticVehicleEx(583,-1516.12121582,-460.05581665,5.40000010,255.99792480,-1,2,15); //Tug
- AddStaticVehicleEx(583,-1512.95678711,-462.37921143,5.40000010,255.99792480,-1,1,15); //Tug
- //text
- Create3DTextLabel("/enter To Enter The Building", 0x008080FF, -1544.0183, -446.6571, 6.0068 , 20.0, 0, 1);
- Create3DTextLabel("/exit To Exit The Building", 0x008080FF, -1543.5156, -446.1675, 6.1000 , 20.0, 0, 1);
- Create3DTextLabel("/opengate1 And /closegate1 To Open And Close The Gate", 0x008080FF, -1544.8187, -443.3832, 6.1000, 20.0, 0, 1);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerTeamFromClass(playerid, classid);
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new string[85],pname[24];
- GetPlayerName(playerid,pname,24);
- format(string,sizeof(string),"%s [%d] Has Joined The Server!",pname,playerid);
- SendClientMessageToAll(0x0,string);
- SendClientMessage(playerid,0xEF4300,"sa-airlines security demo:D");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SendClientMessage(playerid,0x0,"yeh i know xD /q the GM fails xD");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/opengate1", true) == 0)
- {
- if(gTeam[playerid] == 0)
- if(IsPlayerInRangeOfPoint(playerid, 1, -1544.8187, -443.3832, 6.1000, 39.2091))
- MoveObject(gate, -1545.7198486328, -430.60092163086, 10.721339225769, 7.0);
- return 1;
- }
- if(strcmp(cmdtext, "/closegate1", true) == 0)
- {
- if(gTeam[playerid] == 0)
- if(IsPlayerInRangeOfPoint(playerid, 1, -1544.8187, -443.3832, 6.1000, 39.2091))
- MoveObject(gate, -1545.6732177734, -430.65551757813, 6.7213397026062, 7.0);
- return 1;
- }
- if(strcmp(cmdtext, "/enter", true) == 0)
- {
- if(gTeam[playerid] == 0)
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "Player not found");
- }
- if(IsPlayerInRangeOfPoint(playerid, 1, -1544.0183, -446.6571, 6.0068))
- SetPlayerPos(playerid, -1543.5156,-446.1675,6.1000);
- return 1;
- }
- if(strcmp(cmdtext, "/exit", true) == 0)
- {
- if(gTeam[playerid] == 0)
- if(IsPlayerInRangeOfPoint(playerid, 1, -1543.5156,-446.1675,6.1000))
- SetPlayerPos(playerid, -1544.0183, -446.6571, 6.0068);
- return 1;
- }
- return 0;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public SetPlayerTeamFromClass(playerid, classid)
- {
- switch(classid)
- {
- case 0:
- {
- gTeam[playerid] = 0;
- GameTextForPlayer(playerid, "~r~Security", 5000, 5);
- }
- case 1:
- {
- gTeam[playerid] = 1;
- GameTextForPlayer(playerid, "~r~Civilion", 5000, 5);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement