07.06.2013, 02:33
(
Последний раз редактировалось xXitsgodzillaXx; 07.06.2013 в 12:19.
Причина: Re-Edit
)
Okay so for some reason every time i add the prace system to my filterscripts all the other FS's with dialog boxes wont work correctly. I've had this problem before and I fixed it because i wasnt doing "return 1; and the return 0;" at the bottom of "ondialogresponse" So here is that callback on the racing system
Now see at the bottom it says return 1; and then return 1; again, I set the bottom return 1; to return 0; but nothing still happened. Does anyone have any ideas? heres what the callback looks like on my other FS's just so you can get an idea of what im talking about:
There are no dailog id conflicts. Some of the other fs's do this callback differently tho. but this here ^ is generally what most of them look like.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
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 option","{FFFFFF}Do you want this race to be a Chase type?\n(Type 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,"Race's Cost","{FFFFFF}Type the cost to join your race (min 1):","Continue","");
return 1;
}
if(dialogid==DIALOGNOMEGARA)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOGNOMEGARA,DIALOG_STYLE_INPUT,"Race's Name","{FFFFFF}ERROR:\nType the name of your race:","Continua","");
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,"Race's Laps","{FFFFFF}Type the number of laps for your races (1:sprint 2-more:circuit)","Continue","");
return 1;
}
if(dialogid==DIALOGINFOCOSTRUTTORE)
{
ShowPlayerDialog(playerid,DIALOGNOMEGARA,DIALOG_STYLE_INPUT,"Race's Name","{FFFFFF}Type the name of you race:","Continue","");
return 1;
}
if(dialogid==DIALOGINFO) return 1;
if(dialogid==DIALOGGARE && response)
{
if(Giocatore[playerid][IdGara]!=-1) return SendClientMessage(playerid,ROSSO,"[ERROR:] {FFFFFF}You already joined another race.");
if(Gara[listitem][Avviata]==1) return SendClientMessage(playerid,ROSSO,"[ERROR:] {FFFFFF}This race is already started. Wait its ending before joining.");
if(Gara[listitem][Inseguimento]==1)
{
if(Gara[listitem][Partecipanti]==2) return SendClientMessage(playerid,ROSSO,"[ERROR:] {FFFFFF}There are already two player in this race (chase race limit)");
if(Gara[listitem][Partecipanti]==0)
{
SendClientMessage(playerid,BIANCO,"[RACE:] You are the hunted. When the race starts, stay in front of your opponent and try to escape.");
}
if(Gara[listitem][Partecipanti]==1)
{
SendClientMessage(playerid,BIANCO,"[RACE:] You are the hunter. When the race starts, stay behind your opponent and chase him.");
Giocatore[playerid][Inseguitore]=1;
}
}
Giocatore[playerid][IdGara]=listitem;
GetPlayerName(playerid,nome,sizeof(nome));
format(stringa,sizeof(stringa),"{8CE46C}%s {FFFFFF}join the race.",nome);
GivePlayerMoney(playerid,-Gara[listitem][Costo]);
MandaMessaggioPartecipanti(listitem,stringa);
#if defined TELEPORT_TO_START
SetPlayerPos(playerid,CheckpointGara[listitem][0][CXPos],CheckpointGara[listitem][0][CYPos],CheckpointGara[listitem][0][CZPos]);
SendClientMessage(playerid,BIANCO,"[RACE:] You join the race. Type \"{C14124}/Ready{FFFFFF}\" when you are ready.");
#else
SendClientMessage(playerid,BIANCO,"[RACE:] You join the race. Go to the checkpoint and type \"{C14124}/Ready{FFFFFF}\" when you are 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),"{FFFFFF}Track: {8CE46C}%s\n{FFFFFF}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,"Quit","");
return 1;
}
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 6000)
{
if(response)
{
if(listitem == 0)
{
SetPlayerPos(playerid,1129.0205,-1454.4484,15.7969);
SetPlayerFacingAngle(playerid, 181.5882);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 26, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 1;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Shopping /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 1)
{
SetPlayerPos(playerid,2508.3787,2786.6370,10.8203);
SetPlayerFacingAngle(playerid, 181.5882);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 29, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 2;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Factory /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 2)
{
SetPlayerPos(playerid,-926.4914,-498.8946,25.9609);
SetPlayerFacingAngle(playerid, 185.9298);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 27, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 3;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}In a country /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 3)
{
SetPlayerPos(playerid,-2129.3096,-444.2732,35.5344);
SetPlayerFacingAngle(playerid, 185.9298);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 31, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 4;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Colliseum /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 4)
{
SetPlayerPos(playerid,214.5838,1875.3218,17.6406);
SetPlayerFacingAngle(playerid, 185.9298);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 30, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 5;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Secret bace destroy /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 5)
{
SetPlayerPos(playerid,2275.7498,1072.6093,10.8203);
SetPlayerFacingAngle(playerid, 12.7707);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 33, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 6;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}In a prison /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 6)
{
SetPlayerPos(playerid,2257.3013,1086.0162,33.5284);
SetPlayerFacingAngle(playerid, 244.6592);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 26, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 7;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Castle /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 7)
{
SetPlayerPos(playerid,-1465.3469,385.0039,30.0859);
SetPlayerFacingAngle(playerid, 278.0832);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 31, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 8;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Quay /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 8)
{
SetPlayerPos(playerid,-1600.6583,146.1976,-11.1581);
SetPlayerFacingAngle(playerid, 140.7450);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 25, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 9;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Gateway /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 9)
{
SetPlayerPos(playerid,264.6115,2901.8877,8.0913);
SetPlayerFacingAngle(playerid, 330.4140);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 24, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 10;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Sea Rocks /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 10)
{
SetPlayerPos(playerid,-919.1942,2680.9565,42.3703);
SetPlayerFacingAngle(playerid, 125.0316);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 9, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 11;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Sea House /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 11)
{
SetPlayerPos(playerid,-1291.3860,2505.5720,87.0033);
SetPlayerFacingAngle(playerid, 73.1321);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 34, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 12;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Ruins /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 12)
{
SetPlayerPos(playerid, 251.9712,1861.1077,8.7578);
SetPlayerFacingAngle(playerid,130.0588);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid, 22, 50000);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 13;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Radiation /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 13)
{
new veicolo;
veicolo=GetPlayerVehicleID(playerid);
SetPlayerPos(playerid, -2414.8103,1544.5793,31.8594);
SetVehiclePos(veicolo, -2414.8103,1544.5793,31.8594);
SetPlayerInterior(playerid,0);
PutPlayerInVehicle(playerid,veicolo,0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 3, 50000);
GivePlayerWeapon(playerid, 18, 50000);
GivePlayerWeapon(playerid, 22, 50000);
GivePlayerWeapon(playerid, 29, 50000);
GivePlayerWeapon(playerid, 31, 50000);
GivePlayerWeapon(playerid, 33, 50000);
GivePlayerWeapon(playerid, 38, 500);
TogglePlayerControllable(playerid,1);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 14;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Trucks /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 14)
{
new veicolo;
veicolo=GetPlayerVehicleID(playerid);
SetPlayerPos(playerid, -824.7352,2758.3174,45.8516);
SetVehiclePos(veicolo, -824.7352,2758.3174,45.8516);
SetPlayerInterior(playerid,0);
PutPlayerInVehicle(playerid,veicolo,0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 9, 100);
GivePlayerWeapon(playerid, 17, 120);
GivePlayerWeapon(playerid, 23, 250);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 28, 500);
TogglePlayerControllable(playerid,1);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 15;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Igloo /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 15)
{
new veicolo;
veicolo=GetPlayerVehicleID(playerid);
SetPlayerPos(playerid, -533.9329,2615.1489,53.4141);
SetVehiclePos(veicolo, -533.9329,2615.1489,53.4141);
SetPlayerInterior(playerid,0);
PutPlayerInVehicle(playerid,veicolo,0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 39, 50000);
GivePlayerWeapon(playerid, 31, 50000);
GivePlayerWeapon(playerid, 27, 50000);
GivePlayerWeapon(playerid, 23, 50000);
GivePlayerWeapon(playerid, 36, 10);
TogglePlayerControllable(playerid,1);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 16;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Ultimate Fight /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 16)
{
SetPlayerPos(playerid, 763.0002,10.5178,1001.1639);
SetPlayerInterior(playerid,5);
ResetPlayerWeapons(playerid);
TogglePlayerControllable(playerid,1);
GetPlayerName(playerid, pname, sizeof(pname));
dm[playerid] = 17;
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Boxing /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
if(listitem == 17)
{
new veicolo;
veicolo=GetPlayerVehicleID(playerid);
SetPlayerPos(playerid, -1129.2668,1036.4310,1345.7198);
SetVehiclePos(veicolo, -1129.2668,1036.4310,1345.7198);
SetPlayerInterior(playerid,10);
PutPlayerInVehicle(playerid,veicolo,0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 8, 50000);
GivePlayerWeapon(playerid, 16, 50000);
GivePlayerWeapon(playerid, 23, 50000);
GivePlayerWeapon(playerid, 27, 50000);
GivePlayerWeapon(playerid, 28, 50000);
GivePlayerWeapon(playerid, 30, 50000);
GivePlayerWeapon(playerid, 34, 50000);
TogglePlayerControllable(playerid,1);
dm[playerid] = 18;
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{ffffff}%s (ID: %d) {ffcc00}joined deathmatch {00ff00}Film Making /dm", pname, playerid);
SendClientMessageToAll(0xAA3333AA, string);
}
}
return 1;
}
return 0;
}