24.04.2013, 08:41
i made checkpoint and when player enter this checkpoint with vehicle its show him dialog list repair vehicle put spoiler etc ...
and made ondialogresponse
but the list not responing i don't know why
the code
and made ondialogresponse
but the list not responing i don't know why
the code
pawn Код:
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,COLOR_RED,"[ERROR] {FFFFFF}You must be in vehicle in order to enter this checkpoint");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
ShowPlayerDialog(playerid,DIALOG_DOHERTYAUTO,DIALOG_STYLE_LIST,"Doherty Auto","Repair Vehicle - 100\nWheels - 1000\nNitro\nHydraulics - 5000\nSpolier - 5000\nNeon - 5000","Buy","Close");
return 1;
}
pawn Код:
if(dialogid == DIALOG_DOHERTYAUTO)
{
if(response == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
new pveh = GetPlayerVehicleID(playerid);
if(listitem == 0)
{
SetVehicleHealth(pveh, 1000.0);
RepairVehicle(pveh);
GameTextForPlayer(playerid,"Vehicle~n~~g~Repaired",2000,4);
GivePlayerMoney(playerid,-100);
return 1;
}
if(listitem == 1)
{
ShowPlayerDialog(playerid,DIALOG_WHEELS,DIALOG_STYLE_LIST,"{FFFFFF}Wheels","{FFFFFF}Offroad\nShadow\nMega\nRimshine\nWires\nClassic\nTwist\nCutter\nStwich\nGrove\nImport\nDollar\nTrance\nAtomic\nAhab\nVirtual\nAccess","Buy","Close");
return 1;
}
if(listitem == 2)
{
ShowPlayerDialog(playerid,DIALOG_NITRO,DIALOG_STYLE_LIST,"{FFFFFF}Nitro","{FFFFFF}Nitro X2 500\nNitro X5 1000\nNitro X10 10000","Buy","Close");
return 1;
}
if(listitem == 3)
{
AddVehicleComponent(pveh,1087);
GameTextForPlayer(playerid,"~w~Added~n~~g~hydraulics",2000,4);
GivePlayerMoney(playerid,-5000);
return 1;
}
if(listitem == 4)
{
ShowPlayerDialog(playerid,DIALOG_SPOILER,DIALOG_STYLE_LIST,"{FFFFFF}Spoilers","{FFFFFF}Pro\nWin\nFury\nChamp","Buy","Close");
return 1;
}
if(listitem == 5)
{
ShowPlayerDialog(playerid,DIALOG_NEONS,DIALOG_STYLE_LIST,"{FFFFFF}Neons","{FFFFFF}Blue Neon\nGreen Neon\nYellow Neon\nWhite Neon\nPink neon","Buy","Close");
return 1;
}
return 1;
}
return 1;
}
return 1;
}
if(dialogid == DIALOG_WHEELS)
{
if(response == 1)
{
new pveh = GetPlayerVehicleID(playerid);
if(listitem == 0)
{
AddVehicleComponent(pveh,1025);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 1)
{
AddVehicleComponent(pveh,1073);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 2)
{
AddVehicleComponent(pveh,1074);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 3)
{
AddVehicleComponent(pveh,1075);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 4)
{
AddVehicleComponent(pveh,1076);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 5)
{
AddVehicleComponent(pveh,1077);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 6)
{
AddVehicleComponent(pveh,1078);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 7)
{
AddVehicleComponent(pveh,1079);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 8)
{
AddVehicleComponent(pveh,1080);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 9)
{
AddVehicleComponent(pveh,1081);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 10)
{
AddVehicleComponent(pveh,1082);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 11)
{
AddVehicleComponent(pveh,1083);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 12)
{
AddVehicleComponent(pveh,1084);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 13)
{
AddVehicleComponent(pveh,1085);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 14)
{
AddVehicleComponent(pveh,1096);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 15)
{
AddVehicleComponent(pveh,1097);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
if(listitem == 16)
{
AddVehicleComponent(pveh,1098);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Wheel",2000,4);
return 1;
}
return 1;
}
return 1;
}
if(dialogid == DIALOG_NITRO)
{
if(response == 1)
{
new pveh = GetPlayerVehicleID(playerid);
if(listitem == 0)
{
AddVehicleComponent(pveh,1009);
GivePlayerMoney(playerid,-500);
GameTextForPlayer(playerid,"~w~Added~n~~g~Nitro",2000,4);
return 1;
}
if(listitem == 1)
{
AddVehicleComponent(pveh,1008);
GivePlayerMoney(playerid,-1000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Nitro",2000,4);
return 1;
}
if(listitem == 2)
{
AddVehicleComponent(pveh,1010);
GivePlayerMoney(playerid,-10000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Nitro",2000,4);
return 1;
}
return 1;
}
return 1;
}
if(dialogid == DIALOG_SPOILER)
{
new pveh = GetPlayerVehicleID(playerid);
if(response == 1)
{
if(listitem == 0)
{
AddVehicleComponent(pveh,1001);
GivePlayerMoney(playerid,-5000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Spoiler",2000,4);
return 1;
}
if(listitem == 1)
{
AddVehicleComponent(pveh,1000);
GivePlayerMoney(playerid,-5000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Spoiler",2000,4);
return 1;
}
if(listitem == 2)
{
AddVehicleComponent(pveh,1001);
GivePlayerMoney(playerid,-5000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Spoiler",2000,4);
return 1;
}
if(listitem == 3)
{
AddVehicleComponent(pveh,1023);
GivePlayerMoney(playerid,-5000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Spoiler",2000,4);
return 1;
}
if(listitem == 4)
{
AddVehicleComponent(pveh,1014);
GivePlayerMoney(playerid,-5000);
GameTextForPlayer(playerid,"~w~Added~n~~g~Spoiler",2000,4);
return 1;
}
return 1;
}
return 1;
}
if(dialogid == DIALOG_NEONS)
{
if(response == 1)
{
if(listitem == 0)
{
SetPVarInt(playerid, "neon", 1);
SetPVarInt(playerid, "blue", CreateObject(18648,0,0,0,0,0,0));
SetPVarInt(playerid, "blue1", CreateObject(18648,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "blue"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "blue1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~w~Added~n~~g~Neon",200,4);
return 1;
}
if(listitem == 1)
{
SetPVarInt(playerid, "neon", 1);
SetPVarInt(playerid, "green", CreateObject(18649,0,0,0,0,0,0));
SetPVarInt(playerid, "green1", CreateObject(18649,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "green"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "green1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~w~Added~n~~g~Neon",200,4);
return 1;
}
if(listitem == 2)
{
SetPVarInt(playerid, "neon", 1);
SetPVarInt(playerid, "yellow", CreateObject(18650,0,0,0,0,0,0));
SetPVarInt(playerid, "yellow1", CreateObject(18650,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "yellow"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "yellow1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~w~Added~n~~g~Neon",200,4);
return 1;
}
if(listitem == 3)
{
SetPVarInt(playerid, "neon", 1);
SetPVarInt(playerid, "white", CreateObject(18652,0,0,0,0,0,0));
SetPVarInt(playerid, "white1", CreateObject(18652,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "white"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "white1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~w~Added~n~~g~Neon",200,4);
return 1;
}
if(listitem == 4)
{
SetPVarInt(playerid, "neon", 1);
SetPVarInt(playerid, "pink", CreateObject(18651,0,0,0,0,0,0));
SetPVarInt(playerid, "pink1", CreateObject(18651,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "pink"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "pink1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~w~Added~n~~g~Neon",200,4);
return 1;
}
return 1;
}
return 1;
}