Hallo
Ich habe heute mal ein Tutorial mit Checkpoints gescriptet,
nur Leider funktioniert es nicht so ganz.
Ich gehe zum ersten Checkpoint, so wird der zweite Checkpoint nicht erstellt.
Das sollte er aber eigentlich machen. Könnt ihr mir da mal helfen ?
public OnPlayerEnterCheckpoint(playerid)
{
//Tutorial
if(tutorial[playerid] == 1 && IsPlayerInRangeOfPoint(playerid,10.0,1434.0994,-1486.9607,20.4297))
{
SetPlayerCheckpoint(playerid,1744.9891,-1860.6909,13.5784,5.0);
tutorial[playerid]=2;
}
else if(tutorial[playerid] == 2 && IsPlayerInRangeOfPoint(playerid,10.0,1744.9891,-1860.6909,13.5784))
{
SetPlayerCheckpoint(playerid,1624.6079,-1879.7631,13.3828,5.0);
SendClientMessage(playerid,gelb,"Du hast den ersten Checkpoint erreicht");
tutorial[playerid]=3;
}
else if(tutorial[playerid] == 3 && IsPlayerInRangeOfPoint(playerid,10,1624.6079,-1879.7631,13.3828))
{
SetPlayerCheckpoint(playerid,928.5707,-1222.1958,16.9368,5);
tutorial[playerid]=4;
}
else if(tutorial[playerid] == 4 && IsPlayerInRangeOfPoint(playerid,10,928.5707,-1222.1958,16.9368))
{
SetPlayerCheckpoint(playerid,948.9721,-1102.0502,24.0999,5);
tutorial[playerid]=5;
}
else if(tutorial[playerid] == 5 && IsPlayerInRangeOfPoint(playerid,10,948.9721,-1102.0502,24.0999))
{
SetPlayerCheckpoint(playerid,1200.9994,-929.7306,42.9371,5);
tutorial[playerid]=6;
}
else if(tutorial[playerid] == 6 && IsPlayerInRangeOfPoint(playerid,10,1200.9994,-929.7306,42.9371))
{
SetPlayerCheckpoint(playerid,1315.7144,-916.5751,38.0867,5);
tutorial[playerid]=7;
}
else if(tutorial[playerid] == 7 && IsPlayerInRangeOfPoint(playerid,10,1315.7144,-916.5751,38.0867))
{
SetPlayerCheckpoint(playerid,1365.6748,-1279.7814,13.5469,5);
tutorial[playerid]=8;
}
else if(tutorial[playerid] == 8 && IsPlayerInRangeOfPoint(playerid,10,1365.6748,-1279.7814,13.5469))
{
SetPlayerCheckpoint(playerid,817.1156,-1389.5005,13.6242,5);
tutorial[playerid]=9;
}
else if(tutorial[playerid] == 9 && IsPlayerInRangeOfPoint(playerid,10,817.1156,-1389.5005,13.6242))
{
SetPlayerCheckpoint(playerid,1158.2399,-1436.7103,15.7981,5);
tutorial[playerid]=10;
}
else if(tutorial[playerid] == 10 && IsPlayerInRangeOfPoint(playerid,10,1158.2399,-1436.7103,15.7981))
{
tutorial[playerid]=11;
SetPlayerCheckpoint(playerid,1422.8132,-1492.5394,20.4285,5);
}
else if(tutorial[playerid] == 11 && IsPlayerInRangeOfPoint(playerid,10,1422.8132,-1492.5394,20.4285))
{
ShowPlayerDialog(playerid,DIALOG_HINWEIS,DIALOG_STYLE_MSGBOX,"Tutorialpart 11","Vielen Dank für das Tutorial\nWir hoffen es hat dir gefallen\nDu kannst nun mit deinen Leben hier beginnen,\nda du jetzt genug Informationen hast","Ok","");
tutorial[playerid]=0;
}
else
{
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid,"~y~Ziel erreicht",3000,1);
}
return 1;
}
Muss ich da nicht mit OnPlayerLeaveCheckpoint arbeiten ?
ocmd:tutorial(playerid,params[])
{
if(!IsPlayerInRangeOfPoint(playerid,5.0,1434.0994,-1486.9607,20.4297))return SendClientMessage(playerid,weiss,"Hier kann dir keiner das Tutorial anbieten");
if(IsPlayerInFrak(playerid,0))
{
if(tutorial[playerid] == 0)
{
SendClientMessage(playerid,rot,"Tutorial von City of Evil");
SendClientMessage(playerid,grün,"Herzlich Wilkommen auf den Server,");
SendClientMessage(playerid,grün,"Vielen Dank, dass Sie sich für das Tutorial entschieden haben,");
SendClientMessage(playerid,grün,"am Ende bekommen sie ein kleines Geschenk,so miete dir einen Roller,");
SendClientMessage(playerid,grün,"und fahr die wichtigsten Sachen ab, Viel Erfolg dabei, fahr nun zum ersten Checkpoint");
SetPlayerCheckpoint(playerid,1542.5303,-1675.8834,13.5547,4.5);
tutorial[playerid]=1;
}
else if(tutorial[playerid] == 1)
{
SendClientMessage(playerid,weiss,"Tutorial ist schon gestartet");
}
}
return 1;
}
>> Tutorial geht nicht <<
- Batista
- Geschlossen
- Erledigt
-
-
Du erstellst nacheinander die Checkpoints, was an sich nicht falsch ist. Das Problem ist, es kann immer nur ein Checkpoint gleichzeitig angezeigt werden -> 2. Checkpoint spawnt nicht (Klick - Wiki). Vermutete Lösung: DisablePlayerCheckpoint (Wiki).
-
Es Läuft immernochnicht.
Habe das gemacht.
public OnPlayerEnterCheckpoint(playerid)
{
//Tutorial
if(tutorial[playerid] == 1 && IsPlayerInRangeOfPoint(playerid,10.0,1434.0994,-1486.9607,20.4297))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1744.9891,-1860.6909,13.5784,5.0);
tutorial[playerid]=2;
}
else if(tutorial[playerid] == 2 && IsPlayerInRangeOfPoint(playerid,10.0,1744.9891,-1860.6909,13.5784))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1624.6079,-1879.7631,13.3828,5.0);
SendClientMessage(playerid,gelb,"Du hast den ersten Checkpoint erreicht");
tutorial[playerid]=3;
}
else if(tutorial[playerid] == 3 && IsPlayerInRangeOfPoint(playerid,10,1624.6079,-1879.7631,13.3828))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,928.5707,-1222.1958,16.9368,5);
tutorial[playerid]=4;
}
else if(tutorial[playerid] == 4 && IsPlayerInRangeOfPoint(playerid,10,928.5707,-1222.1958,16.9368))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,948.9721,-1102.0502,24.0999,5);
tutorial[playerid]=5;
}
else if(tutorial[playerid] == 5 && IsPlayerInRangeOfPoint(playerid,10,948.9721,-1102.0502,24.0999))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1200.9994,-929.7306,42.9371,5);
tutorial[playerid]=6;
}
else if(tutorial[playerid] == 6 && IsPlayerInRangeOfPoint(playerid,10,1200.9994,-929.7306,42.9371))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1315.7144,-916.5751,38.0867,5);
tutorial[playerid]=7;
}
else if(tutorial[playerid] == 7 && IsPlayerInRangeOfPoint(playerid,10,1315.7144,-916.5751,38.0867))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1365.6748,-1279.7814,13.5469,5);
tutorial[playerid]=8;
}
else if(tutorial[playerid] == 8 && IsPlayerInRangeOfPoint(playerid,10,1365.6748,-1279.7814,13.5469))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,817.1156,-1389.5005,13.6242,5);
tutorial[playerid]=9;
}
else if(tutorial[playerid] == 9 && IsPlayerInRangeOfPoint(playerid,10,817.1156,-1389.5005,13.6242))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1158.2399,-1436.7103,15.7981,5);
tutorial[playerid]=10;
}
else if(tutorial[playerid] == 10 && IsPlayerInRangeOfPoint(playerid,10,1158.2399,-1436.7103,15.7981))
{
DisablePlayerCheckpoint(playerid);
tutorial[playerid]=11;
SetPlayerCheckpoint(playerid,1422.8132,-1492.5394,20.4285,5);
}
else if(tutorial[playerid] == 11 && IsPlayerInRangeOfPoint(playerid,10,1422.8132,-1492.5394,20.4285))
{
DisablePlayerCheckpoint(playerid);
ShowPlayerDialog(playerid,DIALOG_HINWEIS,DIALOG_STYLE_MSGBOX,"Tutorialpart 11","Vielen Dank für das Tutorial\nWir hoffen es hat dir gefallen\nDu kannst nun mit deinen Leben hier beginnen,\nda du jetzt genug Informationen hast","Ok","");
tutorial[playerid]=0;
}
else
{
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid,"~y~Ziel erreicht",3000,1);
}
return 1;
} -
breadfish.de
Hat das Thema geschlossen.