car shop
#1

Hy i make simple car shop but then i go in pickup i shows list of cars but then i want buy car nothing hapens.

Quote:

if(dialogid == DIALOG_TYPE_WANG_CARS && response == 1)
{
switch(listitem)
{
case 1:
{
if(GetPlayerMoney(playerid) >= 100000)
{
new Sabre;
GivePlayerMoney(playerid, -100000);
Sabre = AddStaticVehicle(475, -1957.2974, 268.7513, 35.3599, 71.2474, 0, 1);
PutPlayerInVehicle(playerid, Sabre, 0);
SendClientMessage(playerid, COLOR_ORANGE, "(INFO) You bought an Sabre! Congrats!");
SendClientMessage(playerid, COLOR_ORANGE," You may obtain a insurance from the red checkpoint!");
TogglePlayerControllable(playerid,1);
SetPlayerCheckpoint(playerid, -1957.2974, 268.7513, 35.3599,5.0);
ownedcar[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "(INFO) You don't have this much cash to buy an Sabre!");
}
}

Reply
#2

There is nothing wrong there as far as I know, but maybe there are Dialog ID conflicts ( A same dialog ID )
Example :
pawn Код:
#define WANG_CARS_SHOP 77 // Same dialog ID.
#define ......
#define OTTO_CARS_SHOP 77 // -- Same dialog ID.
Reply
#3

hah lol i forget change then copy
#define DIALOG_TYPE_WANG_CARS 0
#define DIALOG_TYPE_LV_AIRPLANES 0
#define DIALOG_TYPE_SHODY 0
#define DIALOG_TYPE_AUTO_BAHN 0
#define DIALOG_TYPE_BLUEBERY 0
#define DIALOG_TYPE_SUPER_CARS 0
#define DIALOG_TYPE_BOATS 0
Reply
#4

but still cant buy
Quote:

//Dialogs
#define DIALOG_TYPE_WANG_CARS 0
#define DIALOG_TYPE_LV_AIRPLANES 1
#define DIALOG_TYPE_SHODY 2
#define DIALOG_TYPE_AUTO_BAHN 3
#define DIALOG_TYPE_BLUEBERY 4
#define DIALOG_TYPE_SUPER_CARS 5
#define DIALOG_TYPE_BOATS 6


//Pickups
new Wang_cars;
new LV_Airplanes;
new Shody;
new Auto_Bahn;
new Bluebery;
new Super_Cars;
new Boats;
new ownedcar[MAX_PLAYERS];

public OnFilterScriptInit()
{
SetTimer("pickupid", 500, true);
//3DTextLabel
Create3DTextLabel("Wang cars", COLOR_YELLOW, -1974.075439, 280.052734, 34.742362, 40.0, 0, 0);
Create3DTextLabel("LV Airplanes", COLOR_YELLOW, 1673.9597, 1641.0925, 10.4765, 40.0, 0, 0);
Create3DTextLabel("Shody", COLOR_YELLOW, 1669.7485, 1812.5984, 10.4785, 40.0, 0, 0);
Create3DTextLabel("Auto Bahn", COLOR_YELLOW, 2200.4702, 1390.7550, 10.4764, 40.0, 0, 0);
Create3DTextLabel("Bluebery", COLOR_YELLOW, 50.1467, -292.4507, 1.7491, 40.0, 0, 0);
Create3DTextLabel("Super Car's", COLOR_YELLOW, -1654.4547, 1212.1213, 7.2500, 40.0, 0, 0);
Create3DTextLabel("Boats", COLOR_YELLOW, -2213.8416, 2424.6907, 2.4981, 40.0, 0, 0);

//Pickups
Wang_cars = CreatePickup(1318, 2, -1974.075439, 280.052734, 34.742362, 0);
LV_Airplanes = CreatePickup(1318, 2, 1673.9597, 1641.0925, 10.4765, 0);
Shody = CreatePickup(1318, 2, 1669.7485, 1812.5984, 10.4785, 0);
Auto_Bahn = CreatePickup(1318, 2, 2200.4702, 1390.7550, 10.4764, 0);
Bluebery = CreatePickup(1318, 2, 50.1467, -292.4507, 1.7491, 0);
Super_Cars = CreatePickup(1318, 2, -1654.4547, 1212.1213, 7.2500, 0);
Boats = CreatePickup(1318, 2, -2213.8416, 2424.6907, 2.4981, 0);
return 1;
}

//----------------------------------------------------------

public OnPlayerConnect(playerid)
{
SetPlayerMapIcon(playerid, 0, -1974.075439, 280.052734, 34.742362, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 0, 1673.9597, 1641.0925, 10.4765, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 0, 1669.7485, 1812.5984, 10.4785, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 0, 2200.4702, 1390.7550, 10.4764, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 0, 50.1467, -292.4507, 1.7491, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 0, -1654.4547, 1212.1213, 7.2500, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 0, -2213.8416, 2424.6907, 2.4981, 55, 0, MAPICON_LOCAL);

return 1;
}

//----------------------------------------------------------
forward pickupid(playerid);
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Wang_cars)
{
ShowPlayerDialog(playerid, DIALOG_TYPE_WANG_CARS, DIALOG_STYLE_LIST, "Dealership Vehicles", "Server Dealership Vehicles\n1.Sabre ($100000)\n2.Turismo ($400000)\n3.SuperGT ($450000)\n4.Infernus ($500000)\n5.Cheetah ($400000)\n6.Banshee ($350000)\n7.Hotknife ($500000)\n8.NRG-500 ($250000)\n6.Bulet ($350000)", "Buy", "Cancel");
}
if(pickupid == LV_Airplanes)
{
ShowPlayerDialog(playerid, DIALOG_TYPE_LV_AIRPLANES, DIALOG_STYLE_LIST, "Dealership Vehicles", "Server Dealership Vehicles\n1.Dodo ($1000000)\n2.Raindance ($800000)\n3.Nevada ($1500000)\n4.Cargobob ($800000)\n5.Shamal ($2000000)\n6.Cropduster ($1000000)\n7.Beagle ($1000000)\n8.Maveric ($800000)\n9.Leviathan ($1000000)\n10.Stuntplane ($3000000)", "Buy", "Cancel");
}
if(pickupid == Shody)
{
ShowPlayerDialog(playerid, DIALOG_TYPE_SHODY, DIALOG_STYLE_LIST, "Dealership Vehicles", "Server Dealership Vehicles\n1.Voodoo ($50000)\n2.Nebula ($50000)\n3.Landstalker ($70000)\n4.Bravura ($70000)\n5.Buffalo ($100000)\n6.Manana ($50000)", "Buy", "Cancel");
}
if(pickupid == Auto_Bahn)
{
ShowPlayerDialog(playerid, DIALOG_TYPE_AUTO_BAHN, DIALOG_STYLE_LIST, "Dealership Vehicles", "Server Dealership Vehicles\n1.Patriot ($150000)\n2.Sunrise ($250000)\n3.Sultan ($170000)\n4.Stratum ($200000)\n5.Elegy ($250000)\n6.Flash ($250000)\n7.Euros ($250000)\n8.Alpha ($250000)", "Buy", "Cancel");
}
if(pickupid == Bluebery)
{
ShowPlayerDialog(playerid, DIALOG_TYPE_BLUEBERY, DIALOG_STYLE_LIST, "Dealership Vehicles", "Server Dealership Vehicles\n1.Lineruner ($150000)\n2.Dumper ($1000000)\n3.Bobcat ($170000)\n4.Barracks ($200000)\n5.ArticleTrailer ($80000)\n6.Rumpo ($150000)\n7.ArticleTrailer2 ($70000)\n8.Flatbet ($250000)\n9.Yankee ($70000)\n10.Burrito ($150000)\n11.Boxville ($70000)\n12.Benson ($70000)\n13.Tanker ($150000)\n14.Roadtrain ($200000)\n15.Petroltrailer ($80000)\n16.Articletrailer3 ($70000)", "Buy", "Cancel");
}
if(pickupid == Super_Cars)
{
ShowPlayerDialog(playerid, DIALOG_TYPE_SUPER_CARS, DIALOG_STYLE_LIST, "Dealership Vehicles", "Server Dealership Vehicles\n1.BF-400 ($150000)\n2.Dune ($1000000)\n3.Mower ($150000)\n4.Kart ($200000)\n5.MonsterA ($1500000)\n6.MonsterB ($1500000)\n7.FCR-900 ($80000)\n8.BloodingBanger ($1500000)\n9.HotringA ($2000000)\n10.HotringB ($2000000)\n11.HotringC ($2000000)\n12.Sandking ($1500000)\n13.Quad ($700000)\n14.Sanchez ($800000)\n15.Freeway ($100000)\n16.PCJ-600 ($100000)", "Buy", "Cancel");
}
if(pickupid == Boats)
{
ShowPlayerDialog(playerid, DIALOG_TYPE_BOATS, DIALOG_STYLE_LIST, "Dealership Vehicles", "Server Dealership Vehicles\n1.Squallo ($500000)\n2.Seasparrow ($150000)\n3.Speeder ($500000)\n4.Reefer ($150000)\n5.Tropic ($150000)\n6.Skimmer ($150000)\n7.Coastguard ($150000)\n8.Dinghy ($100000)\n9.Marqius ($500000)\n10.Jetmax ($1000000)\n11.Vortex ($800000)", "Buy", "Cancel");
}
return 1;
}

//----------------------------------------------------------

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_TYPE_WANG_CARS && response == 1)
{
switch(listitem)
{
case 1:
{
if(GetPlayerMoney(playerid) >= 100000)
{
new Sabre;
GivePlayerMoney(playerid, -100000);
Sabre = AddStaticVehicle(475, -1957.2974, 268.7513, 35.3599, 71.2474, 0, 1);
PutPlayerInVehicle(playerid, Sabre, 0);
SendClientMessage(playerid, COLOR_ORANGE, "(INFO) You bought an Sabre! Congrats!");
SendClientMessage(playerid, COLOR_ORANGE," You may obtain a insurance from the red checkpoint!");
TogglePlayerControllable(playerid,1);
SetPlayerCheckpoint(playerid, -1957.2974, 268.7513, 35.3599,5.0);
ownedcar[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "(INFO) You don't have this much cash to buy an Sabre!");
}

Reply
#5

pls help
Reply
#6

PLS HELP ALL SCRIPT IS CORRECT BUT THEN DIALOG SHOWS I PRESS CAR NAME AND NOTHING HAPENS DIALOG DISAPEARS I CAN SEND U PWN FILE TO TEST ON YOUR SERVER
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)