Hallo.
Ich habe dieses Filterscript in meinen Gamemode eingebaut. Wenn ich es als Filterscript zu vor geladen habe, ist der Dialog /race erschienen. Nachdem ich ihn aber ins gamemode eingebaut habe, nichtmehr.
Meine DialogID's sind alle verschieden. Ich hab schon echt alles probiert, aber er zeigt mir den Dialog einfach nicht an.
#define DIALOGGAREE 8016
OnPlayerCommandText:
if(!strcmp(cmdtext,"/race",true))
{
if(Giocatore[playerid][Costruttore]==1)
return SendClientMessage(playerid,COLOR_WHITE,"{e1d6a8}* You are building a race, you cant join!!");
format(stringa,sizeof(stringa),"");
for(new i=0;i<=GareCaricate; i++)
{
if(Gara[i][Giri]>1 && Gara[i][Inseguimento]==0)
format(stringa2,sizeof(stringa2),"{e1d6a8}Circuit -{FFFFFF} %s (%d laps)",Gara[i][Nome],Gara[i][Giri]);
if(Gara[i][Giri]==1 && Gara[i][Inseguimento]==0)
format(stringa2,sizeof(stringa2),"{645f4a}Sprint -{FFFFFF} %s",Gara[i][Nome]);
if(Gara[i][Giri]>1 && Gara[i][Inseguimento]==1)
format(stringa2,sizeof(stringa2),"{446ED1}Chase -{FFFFFF} %s (%d laps)",Gara[i][Nome],Gara[i][Giri]);
if(Gara[i][Giri]==1 && Gara[i][Inseguimento]==1)
format(stringa2,sizeof(stringa2),"{446ED1}Chase -{FFFFFF} %s",Gara[i][Nome]);
strins(stringa,stringa2,strlen(stringa),sizeof(stringa));
if(i!=GareCaricate)
strins(stringa,"\n",strlen(stringa),sizeof(stringa));
}
ShowPlayerDialog(playerid,DIALOGGAREE,DIALOG_STYLE_LIST,"Available races",stringa,"Join","Abort");
SendClientMessage(playerid,COLOR_WHITE,"{e1d6a8}* debug test"); // wollte sehen ob es am Befehl selbst liegt, aber die Message wird angezeigt. Dialog nicht.
return 1;
}
OnDialogResponse:
if(dialogid==DIALOGINFOGARA2)
{
Giocatore[playerid][AttivaCheck]=1;
return 1;
}
if(dialogid==DIALOGINSEGUIMENTO)
{
if(strcmp(inputtext,"Yes",true) && strcmp(inputtext,"No",true)) return ShowPlayerDialog(playerid,DIALOGINSEGUIMENTO,DIALOG_STYLE_INPUT,"Chase option","{FFFFFF}ERROR:\nType Yes or No\nDo you want this race to be a Chase type?\n(Type Yes or No)","Continue","");
format(stringa,sizeof(stringa),"Races/Race%d.txt",Giocatore[playerid][GaraEditorId]);
new File:nomegara=fopen(stringa, io_append);
if(!strcmp(inputtext,"Yes",true))
fwrite(nomegara,",1");
if(!strcmp(inputtext,"No",true))
fwrite(nomegara,",0");
fclose(nomegara);
ShowPlayerDialog(playerid,DIALOGINFOGARA2,0,"Race Info Menu","{FFFFFF}You created the race's info file.\nNow you need a checkpoint list.\nUse the command \"{C14124}/check{FFFFFF}\" to create checkpoint for your race.\nOnce you've finished, type \"{C14124}/endcheck{FFFFFF}\" to exit builder mode and load the new race.","Go","");
return 1;
}
if(dialogid==DIALOGCOSTOGARA)
{
if(!strlen(inputtext) || !isNumeric(inputtext) || strval(inputtext)<=0) return ShowPlayerDialog(playerid,DIALOGCOSTOGARA,DIALOG_STYLE_INPUT,"Race's Cost","{FFFFFF}Type the cost to join your race (min 1):","Continue","");
format(stringa,sizeof(stringa),"Races/Race%d.txt",Giocatore[playerid][GaraEditorId]);
new File:nomegara=fopen(stringa, io_append);
GetPlayerName(playerid,nome,sizeof(nome));
format(stringa,sizeof(stringa),"%d,1000,Nobody,%s",strval(inputtext),nome);
fwrite(nomegara,stringa);
fclose(nomegara);
ShowPlayerDialog(playerid,DIALOGINSEGUIMENTO,DIALOG_STYLE_INPUT,"Chase Race?","{FFFFFF}Do you want the race to be a Chase Race?\nAnswer with 'Yes' or 'No'","Continue","");
return 1;
}
if(dialogid==DIALOGGIRIGARA)
{
if(!strlen(inputtext) || !isNumeric(inputtext) || strval(inputtext)<=0) return ShowPlayerDialog(playerid,DIALOGGIRIGARA,DIALOG_STYLE_INPUT,"Race's Laps","{FFFFFF}ERROR:\nType the number of laps for your races (1:sprint 2-more:circuit)","Continue","");
format(stringa,sizeof(stringa),"Races/Race%d.txt",Giocatore[playerid][GaraEditorId]);
new File:nomegara=fopen(stringa, io_append);
format(stringa,sizeof(stringa),"%d,",strval(inputtext));
fwrite(nomegara,stringa);
fclose(nomegara);
ShowPlayerDialog(playerid,DIALOGCOSTOGARA,DIALOG_STYLE_INPUT,"Participate Fee","{FFFFFF}What should the price be to participate in the race?","Continue","");
return 1;
}
if(dialogid==DIALOGNOMEGARA)
{
if(!strlen(inputtext))
return ShowPlayerDialog(playerid,DIALOGNOMEGARA,DIALOG_STYLE_INPUT,"Race Name","{FFFFFF}Please enter the Name of your Race","Continue","") &&
SendClientMessage(playerid, COLOR_WHITE, "What the fuck, enter name dickhead");
format(stringa,sizeof(stringa),"Races/Race%d.txt",Giocatore[playerid][GaraEditorId]);
new File:nomegara=fopen(stringa, io_write);
format(stringa,sizeof(stringa),"%s,",inputtext);
fwrite(nomegara,stringa);
fclose(nomegara);
ShowPlayerDialog(playerid,DIALOGGIRIGARA,DIALOG_STYLE_INPUT,"Amount of Laps","{FFFFFF}How many laps should your race have?\n\nPlease do not choose a high amount.","Continue","");
return 1;
}
if(dialogid==DIALOGINFOCOSTRUTTORE)
{
ShowPlayerDialog(playerid,DIALOGNOMEGARA,DIALOG_STYLE_INPUT,"Race Name","{FFFFFF}Plese enter the Name of your Race","Continue","");
return 1;
}
if(dialogid==DIALOGINFO) return 1;
if(dialogid==DIALOGGAREE && response) // Ansonsten habe ich das nirgends stehen..
{
if(Giocatore[playerid][IdGara]!=-1) return SendClientMessage(playerid,COLOR_GREY,"** You joined a race already. Use /leave to leave the race. ");
if(Gara[listitem][Avviata]==1) return SendClientMessage(playerid,COLOR_GREY,"** The race has started already. Please wait until it ends to start it again.");
if(Gara[listitem][Inseguimento]==1)
{
if(Gara[listitem][Partecipanti]==2) return SendClientMessage(playerid,COLOR_GREY,"** This Chase Race does already have 2 Participants. Please try again later.");
if(Gara[listitem][Partecipanti]==0)
{
SendClientMessage(playerid,COLOR_WHITE,"{e1d6a8}* You are being hunted. Escape from your participant as quick as possible!");
}
if(Gara[listitem][Partecipanti]==1)
{
SendClientMessage(playerid,COLOR_WHITE,"{e1d6a8}* You are the hunter. Chase your enemy as long as possible to win!");
Giocatore[playerid][Inseguitore]=1;
}
}
Giocatore[playerid][IdGara]=listitem;
GetPlayerName(playerid,nome,sizeof(nome));
format(stringa,sizeof(stringa),"{e1d6a8}* Racer {645f4a}%s [%d] {e1d6a8}has joined the race.",nome, playerid);
GivePlayerMoney(playerid,-Gara[listitem][Costo]);
MandaMessaggioPartecipanti(listitem,stringa);
#if defined TELEPORT_TO_START
{
new RaceCar, Float:X,Float:Y,Float:Z, Float:Angle;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
RaceCar = CreateVehicle(411, X,Y,Z+2, Angle, 1, 1, -1);
PutPlayerInVehicle(playerid,RaceCar,0);
SetVehiclePos(GetPlayerVehicleID(playerid),CheckpointGara[listitem][0][CXPos],CheckpointGara[listitem][0][CYPos],CheckpointGara[listitem][0][CZPos]);
}
SendClientMessage(playerid,COLOR_WHITE,"{e1d6a8}* You have joined the race. You can start it with /ready in the checkpoint.");
#else
SendClientMessage(playerid,COLOR_WHITE,"{e1d6a8}* You have joined the race. Type /ready in the checkpoint when you're ready.");
#endif
Gara[listitem][Partecipanti]++;
SetPlayerRaceCheckpoint(playerid,0,CheckpointGara[listitem][0][CXPos],CheckpointGara[listitem][0][CYPos],CheckpointGara[listitem][0][CZPos],CheckpointGara[listitem][1][CXPos],CheckpointGara[listitem][1][CYPos],CheckpointGara[listitem][1][CZPos],9);
new minuti=floatround(Gara[listitem][Record]/60);
new secondi=Gara[listitem][Record]-(minuti*60);
format(stringa,sizeof(stringa),"{e1d6a8}RaceName: {8CE46C}%s\n{e1d6a8}Laps: {8CE46C}%d\n{FFFFFF}Cost: {8CE46C}%d$\n{FFFFFF}Record: {8CE46C}%02d:%02d\n{FFFFFF}Player's Record: {8CE46C}%s\n{FFFFFF}Builder: {8CE46C}%s",Gara[listitem][Nome],Gara[listitem][Giri],Gara[listitem][Costo],minuti,secondi,Gara[listitem][GiocatoreRecord],Gara[listitem][Produttore]);
ShowPlayerDialog(playerid,DIALOGINFO,0,"Race Info",stringa,"Alright","");
return 1;
}
Es kann sich doch nichts schneiden, oder?