Mal wieder vielen Dank Jeffry
Der Dialog mit der Pin scheint soweit zu funktionieren, daß er ihn als random 1-16 speichert.
new string[128];
new pin[64];
switch(GetPVarInt(playerid,"Pin"))
{
case 1:{pin="4564";}
case 2:{pin="4563";}
case 3:{pin="7456";}
case 4:{pin="4567";}
case 5:{pin="1047";}
case 6:{pin="4507";}
case 7:{pin="4467";}
case 8:{pin="3217";}
case 9:{pin="1454";}
case 10:{pin="4204";}
case 11:{pin="3448";}
case 12:{pin="4045";}
case 13:{pin="4254";}
case 14:{pin="6542";}
case 15:{pin="6542";}
case 16:{pin="6547";}
}
format(string,sizeof(string),"[Pin: %i]",GetPVarInt(playerid,"Pin"));
SendClientMessage(playerid,0xFF000FFF,string);
SendClientMessage(playerid,0xFF000FFF,"Falls du diesen vergisst, kannst du ihn bei '/stats' aufrufen");
Funktioniert nicht richtig, da (wenn Random-Pin z.B. 11 ist) "[Pin:11]" und nicht "3448" erscheint.
D.w. (im 2. Dialog mit Pin-Abfrage um das Tor zu öffnen) wird der Pin zwar ausgelesen und (ich hab mir im fall [Pin:11] die 3448 ausm Script geholt)
das Tor bewegt sich,... allerdings klont es sich einfach (Habs nur 1 mal erstellt) und der Timer um das Tor zurück zu bewegen tut auch nicht was er soll. (nachm 1. Timer passiert nicht mehr)
if(dialogid==opengatedialog)
{
if(response==1) //also OK
{
if(strval(inputtext) == 4564)
{
if(GetPVarInt(playerid,"Pin")==1)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 4563)
{
if(GetPVarInt(playerid,"Pin")==2)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 7456)
{
if(GetPVarInt(playerid,"Pin")==3)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 4567)
{
if(GetPVarInt(playerid,"Pin")==4)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 1047)
{
if(GetPVarInt(playerid,"Pin")==5)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 4507)
{
if(GetPVarInt(playerid,"Pin")==6)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 4467)
{
if(GetPVarInt(playerid,"Pin")==7)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 3217)
{
if(GetPVarInt(playerid,"Pin")==8)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 1454)
{
if(GetPVarInt(playerid,"Pin")==9)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 4204)
{
if(GetPVarInt(playerid,"Pin")==10)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 3448)
{
if(GetPVarInt(playerid,"Pin")==11)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 4045)
{
if(GetPVarInt(playerid,"Pin")==12)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 4254)
{
if(GetPVarInt(playerid,"Pin")==13)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 6542)
{
if(GetPVarInt(playerid,"Pin")==14)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 6542)
{
if(GetPVarInt(playerid,"Pin")==15)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
if(strval(inputtext) == 6547)
{
if(GetPVarInt(playerid,"Pin")==16)
{
SetTimer("Freiheit",1000,false);
SendClientMessage(playerid,0xFF000FFF,"Begib dich schnell zum Tor!");
}
}
return 1;
}
if(!response)
{
return 1;
}
if(response==0) //also nein
{
return 1;
}
inseltor1 = CreateObject(988,744.5996100,-4026.3994000,40.4000000,0.0000000,0.0000000,267.9950000); //
forward Freiheitpin(playerid);
public Freiheitpin(playerid)
{
new Pin = random(15);
switch(Pin)
{
case 0: Pin = 1;//4564;
case 1: Pin = 2;//4563;
case 2: Pin = 3;//7456;
case 3: Pin = 4;//4567;
case 4: Pin = 5;//1047;
case 5: Pin = 6;//4507;
case 6: Pin = 7;//4467;
case 7: Pin = 8;//3217;
case 8: Pin = 9;//1454;
case 9: Pin = 10;//4204;
case 10: Pin = 11;//3448;
case 11: Pin = 12;//4045;
case 12: Pin = 13;//4254;
case 13: Pin = 14;//6542;
case 14: Pin = 15;//6542;
case 15: Pin = 16;//6547;
}
SetPVarInt(playerid,"Pin",Pin);
SpielerSpeichern(playerid);
new string[128];
new pin[64];
switch(GetPVarInt(playerid,"Pin"))
{
case 1:{pin="4564";}
case 2:{pin="4563";}
case 3:{pin="7456";}
case 4:{pin="4567";}
case 5:{pin="1047";}
case 6:{pin="4507";}
case 7:{pin="4467";}
case 8:{pin="3217";}
case 9:{pin="1454";}
case 10:{pin="4204";}
case 11:{pin="3448";}
case 12:{pin="4045";}
case 13:{pin="4254";}
case 14:{pin="6542";}
case 15:{pin="6542";}
case 16:{pin="6547";}
}
format(string,sizeof(string),"[Pin: %i]",GetPVarInt(playerid,"Pin"));
SendClientMessage(playerid,0xFF000FFF,string);
SendClientMessage(playerid,0xFF000FFF,"Falls du diesen vergisst, kannst du ihn bei '/stats' aufrufen");
}
forward Freiheit(playerid);
public Freiheit(playerid)
{
MoveObject(inseltor1,744.5,-4021.2,40.4,3);
if(GetPlayerScore(playerid)<=1)
{
if(IsPlayerInArea(playerid,740,-4020,763,-4036))
{
SpawnPlayer(playerid);
SetTimer("Freiheit2",5000,false);
}
}
}
forward Freiheit2(playerid);
public Freiheit2(playerid)
{
if(GetPlayerScore(playerid)<=1)
{
if(IsPlayerInArea(playerid,740,-4020,763,-4036))
{
SpawnPlayer(playerid);
SetTimer("Freiheitback",3000,false);
}
}
}
forward Freiheitback(playerid);
public Freiheitback(playerid)
{
MoveObject(inseltor1,744.5,-4026.4,40.4,3);
if(GetPlayerScore(playerid)<=1)
{
if(IsPlayerInArea(playerid,740,-4020,763,-4036))
{
SpawnPlayer(playerid);
}
}
}
Danke für die Mühe