Szerző Téma: Jelszvas Kapu Hiba!  (Megtekintve 559 alkalommal)

Nem elérhető scripter01

  • 1035
  • Ex Moderálisan Globális
    • Profil megtekintése
Jelszvas Kapu Hiba!
« Dátum: 2012. április 10. - 21:46:08 »
0 Show voters
Sziasztok pár napja írtam hogy kell nekem egy textdrawos jelszavas kapu, nos meg is kaptam de nem bírtam a véremmel és át akarom írni minden ár úgy hogy /nyit ra ki dobja a jelszó ablakot majd be írom a helyes jelszót akkor le nyiljon a kapu és majd /zar parancsal be záruljon nos igen addig jutottam el hogy /nyit meg jelenik a jelszavas ablak és tovább.....
 

//Változó
new kapum;
//Kapu Zárva
kapum = CreateObject(980, -2077.1513671875, 1367.1722412109, 8.8499526977539, 0, 0, 180);
//Kapu Záró Parancs
CMD:zar(playerid, params[])
{
MoveObject(kapum,-2077.1513671875, 1367.1722412109, 8.8499526977539, 5.0);
return 1;
}
//Kapu Nyitó Parancs
CMD:nyit(player, params[])
{
kapum = 0;
for(new i=0; i<MAX_PLAYERS; i++)
{
}
PlaySoundForAll(1153, 297.750427, 1821.698852, 6.818514);
GameTextForPlayer(player, \"~G~JELSZO ELFOGADVA\", 3000, 3);
GameTextForPlayer(player, \"~R~JELSZO MEGTAGADVA\", 3000, 3);
new result = ShowPlayerKeypad(player, KEYPAD_BLASTDOOR, \"1997\");
if(result == CREATEKEYPAD_RETURN_INVALID_ID) return SendClientMessage(player, COLOR_RED, \"Invalid keypad ID passed to CreateKeypad().\");
if(result == CREATEKEYPAD_RETURN_NUM) return SendClientMessage(player, COLOR_RED, \"Invalid keypad string (non-numerical) passed to CreateKeypad().\");
    MoveObject(kapum,-2077.1513671875, 1367.1722412109, 3.1499495506287, 5.0);
return 1;
}

 
Nos, mi lehet a gond igaz nem szoktam sokszor segítséget kérni inkább adok :D
De ez most meg fogott és fogalmam sincs mit tehetnék :S
Aki segít megy neki a +!

Nem elérhető Erik3333

  • 945
  • SMF | phpBB | TS3 | PHP | HTML | CSS | JS | PAWN | JAVA
    • Profil megtekintése
Jelszvas Kapu Hiba!
« Válasz #1 Dátum: 2012. április 11. - 08:07:07 »
0 Show voters
Itt van egy, a koordinátákat majd írd át.
[pawn]#include <a_samp>
#include <keypad>
#define KEYPAD_BLASTDOOR 1 // The ID for the keypad we will use
#define COLOR_RED 0xFF0000FF
new blast_door_obj; // The blast door object
new blast_door_open; // 0=closed 1=open
new failed_attempts;
main() {}
public OnGameModeInit()
{
    AddPlayerClass(287,269.0947,1816.5649,4.7031,270,WEAPON_M4,99999,WEAPON_DEAGLE,99999,WEAPON_ROCKETLAUNCHER,99999);
   
    blast_door_obj = CreateObject(2951, 297.750427, 1821.698852, 6.818514, 0.000000, 0.000000, 0.000000);
CreateObject(2922, 300.285827, 1820.455688, 8.420514, 0.000000, 0.000000, 90.000000);
CreateObject(2951, 277.450408, 1821.668823, 6.818513, 0.000000, 0.000000, 0.000000);
CreateObject(2951, 264.481964, 1816.567749, 6.566123, 0.000000, 90.000000, 90.000000);
CreateObject(2951, 264.481964, 1816.582397, 6.566123, 0.000000, 90.000000, 270.000000);
// Invisible walls to prevent escape
CreateObject(19382, 259.803558, 1818.141113, 3.653130, 0.000000, 90.000000, 0.000000);
CreateObject(19382, 259.803558, 1820.141113, 3.653130, 0.000000, 90.000000, 0.000000);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetTimerEx(\"auto_spawn\", 123, 0, \"i\", playerid);
return 1;
}
forward auto_spawn(playerid);
public auto_spawn(playerid)
{
SpawnPlayer(playerid); // Skip class selection
return 1;
}
public OnPlayerSpawn(playerid)
{
//if(!blast_door_open) SetPlayerCheckpoint(playerid, 299.4105,1820.4812,7.8205, 1);
SendClientMessage(playerid, -1, \"Welcome to the example gamemode for {FFFF82}Mike (MP2)\'s{FFFFFF} keypad include.\");
SendClientMessage(playerid, -1, \"Enter the {B3191F}checkpoint{FFFFFF} to access the keypad.\");
SendClientMessage(playerid, -1, \"The code is {FFFF82}1337{FFFFFF}.\");
SendClientMessage(playerid, 0x00FF00FF, \"Enjoy!\");
return 1;
}
/*public OnPlayerEnterCheckpoint(playerid)
{
// Create a keypad for \'playerid\' with the defined ID of \'KEYPAD_BLASTDOOR\' (see top of script) with the key \'1337\'
new result = ShowPlayerKeypad(playerid, KEYPAD_BLASTDOOR, \"1337\");
if(result == CREATEKEYPAD_RETURN_INVALID_ID) return SendClientMessage(playerid, COLOR_RED, \"Invalid keypad ID passed to CreateKeypad().\");
if(result == CREATEKEYPAD_RETURN_NUM) return SendClientMessage(playerid, COLOR_RED, \"Invalid keypad string (non-numerical) passed to CreateKeypad().\");
return 1;
}*/
public OnPlayerKeypadInput(playerid, keypadID, type, key) // \'key\' contains the number that has already been entered in it\'s entirety
{
if(keypadID == KEYPAD_BLASTDOOR && type == KEYPAD_INPUT_GOOD)
{
    OpenBlastDoor(); // Open the blast door!
    for(new i=0; i<MAX_PLAYERS; i++)
   {
      //DisablePlayerCheckpoint(i);
      if(GetPlayerKeypad(i) == KEYPAD_BLASTDOOR) HideKeypad(i); // If any other players have the blast door keypad open, close it
   }
    GameTextForPlayer(playerid, \"~G~access granted\", 3000, 3);
    failed_attempts = 0; // Reset failed attempts
}
else if(keypadID == KEYPAD_BLASTDOOR && type == KEYPAD_INPUT_BAD)
{
   GameTextForPlayer(playerid, \"~R~access denied\", 3000, 3);
   failed_attempts++;
   if(failed_attempts == 3)
   {
       for(new i=0; i<MAX_PLAYERS; i++) //DisablePlayerCheckpoint(i);
      
       PlaySoundForAll(13610);
       SetTimer(\"sound_alarm\", 4000, false);
       SetTimer(\"alarm_off\", 20000, false);
      
       failed_attempts = 0; // Reset the counter
   }
}
return 1;
}
forward sound_alarm();
public sound_alarm()
{
PlaySoundForAll(6001);
return 1;
}
forward alarm_off();
public alarm_off()
{
PlaySoundForAll(13606);
for(new i=0; i<MAX_PLAYERS; i++)
{
    //SetPlayerCheckpoint(i, 299.4105,1820.4812,7.8205, 1);
}
return 1;
}
stock OpenBlastDoor()
{
MoveObject(blast_door_obj, 297.750427, 1821.698852, 6.818514 + 3.5, 0.5);
blast_door_open = 1;
PlaySoundForAll(1153, 297.750427, 1821.698852, 6.818514);
SetTimer(\"close_blast_door\", 10000, 0);
return 1;
}
forward close_blast_door();
public close_blast_door()
{
    MoveObject(blast_door_obj, 297.750427, 1821.698852, 6.818514, 0.5);
   
    blast_door_open = 0;
   
for(new i=0; i<MAX_PLAYERS; i++)
{
    //SetPlayerCheckpoint(i, 299.4105,1820.4812,7.8205, 1);
}
PlaySoundForAll(1153, 297.750427, 1821.698852, 6.818514);
    return 1;
}
public OnObjectMoved(objectid)
{
if(objectid == blast_door_obj)
{
    PlaySoundForAll(1154, 297.750427, 1821.698852, 6.818514);
}
return 1;
}
stock PlaySoundForAll(soundid, Float:x=0.0, Float:y=0.0, Float:z=0.0)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
    PlayerPlaySound(i, soundid, x, y, z);
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/nyit\", cmdtext, true, 10) == 0)
{
   if(IsPlayerInRangeOfPoint(playerid, 299.4105,1820.4812,7.8205))
   {
      new result = ShowPlayerKeypad(playerid, KEYPAD_BLASTDOOR, \"1337\");
      if(result == CREATEKEYPAD_RETURN_INVALID_ID) return SendClientMessage(playerid, COLOR_RED, \"Invalid keypad ID passed to CreateKeypad().\");
      if(result == CREATEKEYPAD_RETURN_NUM) return SendClientMessage(playerid, COLOR_RED, \"Invalid keypad string (non-numerical) passed to CreateKeypad().\");
      return 1;
   }
}
return 0;
}[/pawn]
(Nem biztos, hogy jó)

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal