Mooin,
hab mal ein eine Grenze mit Schranken erstellt
Mit /os öffnet man die Schranke und mit /cs schliesst man sie.
Es gibt auch alle 10 Minuten für den jenigen der bei den Schranken steht ein Gehalt von 1000$.Könnt ihr ja ändern.
Falls ihr Bugs findet sagt mir bescheid bitte :).Naja is nichts besonderes aber wollte das mal mit den Schranken testen^^
=========VIDEO=================
http://www.myvideo.de/watch/6361836
=========DOWNLOAD=============
Pastebin: http://pastebin.com/f24206629
.pwn: http://uploaded.to/file/cjb6z5
.amx: http://uploaded.to/file/04ovxk
===Befehl nur für bestimmte Fraktion(GF)====
Kopiere das zu den new's
new schranke2;
new s2e;
new s2a;
new gehalt;
new s2i;
new schranke1;
new s1e;
new s1a;
new s1i;
Und das bei den forwards:
forward gehalt2(playerid);
forward gehalt2(playerid);
Und das unter OnGameModeInit
CreateObject(8168, -36.042252, -1355.922485, 12.074675, 0.0000, 0.0000, 236.1728);
CreateObject(8168, -78.978630, -1422.714722, 12.978172, 0.0000, 0.0000, 57.1094);
CreateObject(966, -40.515198, -1356.760132, 10.198129, 0.0000, 0.0000, 310.7028);
CreateObject(966, -74.505173, -1422.646484, 11.224788, 0.0000, 359.1406, 129.7661);
CreateObject(8674, -86.648888, -1419.264404, 12.835505, 0.0000, 0.8594, 311.4849);
schranke2 = CreateObject(968, -40.381306, -1356.923950, 11.057382, 0.0000, 268.8997, 310.7028);
schranke1 = CreateObject(968, -74.565208, -1422.592163, 12.008337, 0.0000, 89.3814, 309.7660);
// Pickups
s2e = CreatePickup(1559, 23, -38.9833,-1359.6653,11.2079); // Schranke 2 Eingang
s2a = CreatePickup(1559, 23, -37.8907,-1358.6743,11.1854); // Schranke 2 Ausgang
s2i = CreatePickup(1239, 1, -38.2137,-1356.2357,11.1660); // Schranke 2 Öffnen Schliessen
s1e = CreatePickup(1559, 23, -76.1765,-1419.0085,12.1856); // Schranke 1 Eingang
s1a = CreatePickup(1559, 23, -77.4372,-1420.2062,12.2170); // Schranke 1 Ausgang
s1i = CreatePickup(1239, 1, -77.5049,-1422.2249,12.2433); // Schranke 1 Öffnen Schliessen
CreateObject(8168, -36.042252, -1355.922485, 12.074675, 0.0000, 0.0000, 236.1728);
CreateObject(8168, -78.978630, -1422.714722, 12.978172, 0.0000, 0.0000, 57.1094);
CreateObject(966, -40.515198, -1356.760132, 10.198129, 0.0000, 0.0000, 310.7028);
CreateObject(966, -74.505173, -1422.646484, 11.224788, 0.0000, 359.1406, 129.7661);
CreateObject(8674, -86.648888, -1419.264404, 12.835505, 0.0000, 0.8594, 311.4849);
schranke2 = CreateObject(968, -40.381306, -1356.923950, 11.057382, 0.0000, 268.8997, 310.7028);
schranke1 = CreateObject(968, -74.565208, -1422.592163, 12.008337, 0.0000, 89.3814, 309.7660);
// Pickups
s2e = CreatePickup(1559, 23, -38.9833,-1359.6653,11.2079); // Schranke 2 Eingang
s2a = CreatePickup(1559, 23, -37.8907,-1358.6743,11.1854); // Schranke 2 Ausgang
s2i = CreatePickup(1239, 1, -38.2137,-1356.2357,11.1660); // Schranke 2 Öffnen Schliessen
s1e = CreatePickup(1559, 23, -76.1765,-1419.0085,12.1856); // Schranke 1 Eingang
s1a = CreatePickup(1559, 23, -77.4372,-1420.2062,12.2170); // Schranke 1 Ausgang
s1i = CreatePickup(1239, 1, -77.5049,-1422.2249,12.2433); // Schranke 1 Öffnen Schliessen
Das bei OnPlayerCommandText
if(strcmp(cmdtext, "/schranke", true) == 0 || strcmp(cmdtext, "/os", true) == 0)
{
if(PlayerToPoint(3, playerid, -38.2137,-1356.2357,11.1660))
{
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) // Hier FraktionsID ändern
{
SetObjectRot(schranke2,0.0000, 0.0000, 310.6260);
return 1;
}
}
else if(PlayerToPoint(3, playerid, -77.5049,-1422.2249,12.2433))
{
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) // Hier FraktionsID ändern
{
SetObjectRot(schranke1,0.0000, 0.0000, 309.7660);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "***Du gehörst nicht zum Zoll***");
}
}
if(strcmp(cmdtext, "/schranke", true) == 0 || strcmp(cmdtext, "/os", true) == 0)
{
if(PlayerToPoint(3, playerid, -38.2137,-1356.2357,11.1660))
{
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) // Hier FraktionsID ändern
{
SetObjectRot(schranke2,0.0000, 0.0000, 310.6260);
return 1;
}
}
else if(PlayerToPoint(3, playerid, -77.5049,-1422.2249,12.2433))
{
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) // Hier FraktionsID ändern
{
SetObjectRot(schranke1,0.0000, 0.0000, 309.7660);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "***Du gehörst nicht zum Zoll***");
}
}
und das auch bei OnPlayerCommandText
if(strcmp(cmdtext, "/schrankezu", true) == 0 || strcmp(cmdtext, "/cs", true) == 0)
{
if(PlayerToPoint(3, playerid, -38.2137,-1356.2357,11.1660))
{
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) // Hier FraktionsID ändern
{
SetObjectRot(schranke2,0.0000, 268.8997, 310.7028);
return 1;
}
}
else if(PlayerToPoint(3, playerid, -77.5049,-1422.2249,12.2433))
{
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) // Hier FraktionsID ändern
{
SetObjectRot(schranke1,0.0000, 269.7591, 310.7028);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "***Du gehörst nicht zum Zoll***");
}
}
if(strcmp(cmdtext, "/schrankezu", true) == 0 || strcmp(cmdtext, "/cs", true) == 0)
{
if(PlayerToPoint(3, playerid, -38.2137,-1356.2357,11.1660))
{
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) // Hier FraktionsID ändern
{
SetObjectRot(schranke2,0.0000, 268.8997, 310.7028);
return 1;
}
}
else if(PlayerToPoint(3, playerid, -77.5049,-1422.2249,12.2433))
{
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) // Hier FraktionsID ändern
{
SetObjectRot(schranke1,0.0000, 269.7591, 310.7028);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "***Du gehörst nicht zum Zoll***");
}
}
und das bei OnPlayerPickUpPickup
if(pickupid == s2e)
{
SetPlayerPos(playerid,-36.2911,-1357.5197,11.1553);
gehalt = SetTimer("gehalt2", 600000, 1);
}
if(pickupid == s2a)
{
SetPlayerPos(playerid,-40.0940,-1360.5769,11.2299);
KillTimer(gehalt);
}
if(pickupid == s2i)
{
GameTextForPlayer(playerid, "~g~/os~w~ zum oeffnen~n~~r~/cs~w~ zum schliessen", 5000, 5);
}
if(pickupid == s1e)
{
SetPlayerPos(playerid,-78.8557,-1421.2073,12.2475);
gehalt = SetTimer("gehalt2", 600000, 1);
}
if(pickupid == s1a)
{
SetPlayerPos(playerid,-73.8147,-1416.6626,12.1252);
KillTimer(gehalt);
}
if(pickupid == s1i)
{
GameTextForPlayer(playerid, "~g~/os~w~ zum oeffnen~n~~r~/cs~w~ zum schliessen", 5000, 5);
}
Und das irgentwo nach ganz unten:
public gehalt2(playerid)
{
for (new i = 0; i < MAX_PLAYERS; i++) {
SendClientMessage(i,COLOR_LIGHTBLUE,"Gehalt: 1000$");
GivePlayerMoney(playerid, 1000); // Gehalt
}
return 1;
}
if(pickupid == s2e)
{
SetPlayerPos(playerid,-36.2911,-1357.5197,11.1553);
gehalt = SetTimer("gehalt2", 600000, 1);
}
if(pickupid == s2a)
{
SetPlayerPos(playerid,-40.0940,-1360.5769,11.2299);
KillTimer(gehalt);
}
if(pickupid == s2i)
{
GameTextForPlayer(playerid, "~g~/os~w~ zum oeffnen~n~~r~/cs~w~ zum schliessen", 5000, 5);
}
if(pickupid == s1e)
{
SetPlayerPos(playerid,-78.8557,-1421.2073,12.2475);
gehalt = SetTimer("gehalt2", 600000, 1);
}
if(pickupid == s1a)
{
SetPlayerPos(playerid,-73.8147,-1416.6626,12.1252);
KillTimer(gehalt);
}
if(pickupid == s1i)
{
GameTextForPlayer(playerid, "~g~/os~w~ zum oeffnen~n~~r~/cs~w~ zum schliessen", 5000, 5);
}
Und das irgentwo nach ganz unten:
public gehalt2(playerid)
{
for (new i = 0; i < MAX_PLAYERS; i++) {
SendClientMessage(i,COLOR_LIGHTBLUE,"Gehalt: 1000$");
GivePlayerMoney(playerid, 1000); // Gehalt
}
return 1;
}
===Befehl nur für bestimmten Job(GF)====
Kopiere das zu den new's
new schranke2;
new s2e;
new s2a;
new gehalt;
new s2i;
new schranke1;
new s1e;
new s1a;
new s1i;
Und das bei den forwards:
forward gehalt2(playerid);
forward gehalt2(playerid);
Und das unter OnGameModeInit
CreateObject(8168, -36.042252, -1355.922485, 12.074675, 0.0000, 0.0000, 236.1728);
CreateObject(8168, -78.978630, -1422.714722, 12.978172, 0.0000, 0.0000, 57.1094);
CreateObject(966, -40.515198, -1356.760132, 10.198129, 0.0000, 0.0000, 310.7028);
CreateObject(966, -74.505173, -1422.646484, 11.224788, 0.0000, 359.1406, 129.7661);
CreateObject(8674, -86.648888, -1419.264404, 12.835505, 0.0000, 0.8594, 311.4849);
schranke2 = CreateObject(968, -40.381306, -1356.923950, 11.057382, 0.0000, 268.8997, 310.7028);
schranke1 = CreateObject(968, -74.565208, -1422.592163, 12.008337, 0.0000, 89.3814, 309.7660);
// Pickups
s2e = CreatePickup(1559, 23, -38.9833,-1359.6653,11.2079); // Schranke 2 Eingang
s2a = CreatePickup(1559, 23, -37.8907,-1358.6743,11.1854); // Schranke 2 Ausgang
s2i = CreatePickup(1239, 1, -38.2137,-1356.2357,11.1660); // Schranke 2 Öffnen Schliessen
s1e = CreatePickup(1559, 23, -76.1765,-1419.0085,12.1856); // Schranke 1 Eingang
s1a = CreatePickup(1559, 23, -77.4372,-1420.2062,12.2170); // Schranke 1 Ausgang
s1i = CreatePickup(1239, 1, -77.5049,-1422.2249,12.2433); // Schranke 1 Öffnen Schliessen
CreateObject(8168, -36.042252, -1355.922485, 12.074675, 0.0000, 0.0000, 236.1728);
CreateObject(8168, -78.978630, -1422.714722, 12.978172, 0.0000, 0.0000, 57.1094);
CreateObject(966, -40.515198, -1356.760132, 10.198129, 0.0000, 0.0000, 310.7028);
CreateObject(966, -74.505173, -1422.646484, 11.224788, 0.0000, 359.1406, 129.7661);
CreateObject(8674, -86.648888, -1419.264404, 12.835505, 0.0000, 0.8594, 311.4849);
schranke2 = CreateObject(968, -40.381306, -1356.923950, 11.057382, 0.0000, 268.8997, 310.7028);
schranke1 = CreateObject(968, -74.565208, -1422.592163, 12.008337, 0.0000, 89.3814, 309.7660);
// Pickups
s2e = CreatePickup(1559, 23, -38.9833,-1359.6653,11.2079); // Schranke 2 Eingang
s2a = CreatePickup(1559, 23, -37.8907,-1358.6743,11.1854); // Schranke 2 Ausgang
s2i = CreatePickup(1239, 1, -38.2137,-1356.2357,11.1660); // Schranke 2 Öffnen Schliessen
s1e = CreatePickup(1559, 23, -76.1765,-1419.0085,12.1856); // Schranke 1 Eingang
s1a = CreatePickup(1559, 23, -77.4372,-1420.2062,12.2170); // Schranke 1 Ausgang
s1i = CreatePickup(1239, 1, -77.5049,-1422.2249,12.2433); // Schranke 1 Öffnen Schliessen
Das bei OnPlayerCommandText
if(strcmp(cmdtext, "/schranke", true) == 0 || strcmp(cmdtext, "/os", true) == 0)
{
if(PlayerToPoint(3, playerid, -38.2137,-1356.2357,11.1660))
{
if(PlayerInfo[playerid][pJob] == 7) // Hier JobID ändern
{
SetObjectRot(schranke2,0.0000, 0.0000, 310.6260);
return 1;
}
}
else if(PlayerToPoint(3, playerid, -77.5049,-1422.2249,12.2433))
{
if(PlayerInfo[playerid][pJob] == 7) // Hier JobID ändern
{
SetObjectRot(schranke1,0.0000, 0.0000, 309.7660);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "***Du gehörst nicht zum Zoll***");
}
}
if(strcmp(cmdtext, "/schranke", true) == 0 || strcmp(cmdtext, "/os", true) == 0)
{
if(PlayerToPoint(3, playerid, -38.2137,-1356.2357,11.1660))
{
if(PlayerInfo[playerid][pJob] == 7) // Hier JobID ändern
{
SetObjectRot(schranke2,0.0000, 0.0000, 310.6260);
return 1;
}
}
else if(PlayerToPoint(3, playerid, -77.5049,-1422.2249,12.2433))
{
if(PlayerInfo[playerid][pJob] == 7) // Hier JobID ändern
{
SetObjectRot(schranke1,0.0000, 0.0000, 309.7660);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "***Du gehörst nicht zum Zoll***");
}
}
und das auch bei OnPlayerCommandText
if(strcmp(cmdtext, "/schrankezu", true) == 0 || strcmp(cmdtext, "/cs", true) == 0)
{
if(PlayerToPoint(3, playerid, -38.2137,-1356.2357,11.1660))
{
if(PlayerInfo[playerid][pJob] == 7) // Hier JobID ändern
{
SetObjectRot(schranke2,0.0000, 268.8997, 310.7028);
return 1;
}
}
else if(PlayerToPoint(3, playerid, -77.5049,-1422.2249,12.2433))
{
if(PlayerInfo[playerid][pJob] == 7) // Hier JobID ändern
{
SetObjectRot(schranke1,0.0000, 269.7591, 310.7028);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "***Du gehörst nicht zum Zoll***");
}
}
if(strcmp(cmdtext, "/schrankezu", true) == 0 || strcmp(cmdtext, "/cs", true) == 0)
{
if(PlayerToPoint(3, playerid, -38.2137,-1356.2357,11.1660))
{
if(PlayerInfo[playerid][pJob] == 7) // Hier JobID ändern
{
SetObjectRot(schranke2,0.0000, 268.8997, 310.7028);
return 1;
}
}
else if(PlayerToPoint(3, playerid, -77.5049,-1422.2249,12.2433))
{
if(PlayerInfo[playerid][pJob] == 7) // Hier JobID ändern
{
SetObjectRot(schranke1,0.0000, 269.7591, 310.7028);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "***Du gehörst nicht zum Zoll***");
}
}
und das bei OnPlayerPickUpPickup
if(pickupid == s2e)
{
SetPlayerPos(playerid,-36.2911,-1357.5197,11.1553);
gehalt = SetTimer("gehalt2", 600000, 1);
}
if(pickupid == s2a)
{
SetPlayerPos(playerid,-40.0940,-1360.5769,11.2299);
KillTimer(gehalt);
}
if(pickupid == s2i)
{
GameTextForPlayer(playerid, "~g~/os~w~ zum oeffnen~n~~r~/cs~w~ zum schliessen", 5000, 5);
}
if(pickupid == s1e)
{
SetPlayerPos(playerid,-78.8557,-1421.2073,12.2475);
gehalt = SetTimer("gehalt2", 600000, 1);
}
if(pickupid == s1a)
{
SetPlayerPos(playerid,-73.8147,-1416.6626,12.1252);
KillTimer(gehalt);
}
if(pickupid == s1i)
{
GameTextForPlayer(playerid, "~g~/os~w~ zum oeffnen~n~~r~/cs~w~ zum schliessen", 5000, 5);
}
Und das irgentwo nach ganz unten:
public gehalt2(playerid)
{
for (new i = 0; i < MAX_PLAYERS; i++) {
SendClientMessage(i,COLOR_LIGHTBLUE,"Gehalt: 1000$");
GivePlayerMoney(playerid, 1000); // Gehalt
}
return 1;
}
if(pickupid == s2e)
{
SetPlayerPos(playerid,-36.2911,-1357.5197,11.1553);
gehalt = SetTimer("gehalt2", 600000, 1);
}
if(pickupid == s2a)
{
SetPlayerPos(playerid,-40.0940,-1360.5769,11.2299);
KillTimer(gehalt);
}
if(pickupid == s2i)
{
GameTextForPlayer(playerid, "~g~/os~w~ zum oeffnen~n~~r~/cs~w~ zum schliessen", 5000, 5);
}
if(pickupid == s1e)
{
SetPlayerPos(playerid,-78.8557,-1421.2073,12.2475);
gehalt = SetTimer("gehalt2", 600000, 1);
}
if(pickupid == s1a)
{
SetPlayerPos(playerid,-73.8147,-1416.6626,12.1252);
KillTimer(gehalt);
}
if(pickupid == s1i)
{
GameTextForPlayer(playerid, "~g~/os~w~ zum oeffnen~n~~r~/cs~w~ zum schliessen", 5000, 5);
}
Und das irgentwo nach ganz unten:
public gehalt2(playerid)
{
for (new i = 0; i < MAX_PLAYERS; i++) {
SendClientMessage(i,COLOR_LIGHTBLUE,"Gehalt: 1000$");
GivePlayerMoney(playerid, 1000); // Gehalt
}
return 1;
}