Create Pick Up! Need Help!! -
iOmar - 19.06.2012
I did this:
pawn Код:
#include <a_samp>
#define red 0xFF0000FF
new breifcase;
new breifcase2;
public OnGameModeInit()
{
breifcase = CreatePickup(1210, 23, -253.0094, 2603.0115, 62.8582, -1);
breifcase2 = CreatePickup(1210, 23, 391.0510, 2533.7251, 16.5426, -1);
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == breifcase)
{
ShowPlayerDialog(playerid, 2341, DIALOG_STYLE_LIST, "UDC Base Breifcase Menu", "Health {$2000}\nArmour {$2500}\nDesert Eagle {$3000}\nShotgun {$5000}\nSawn-Off Shotgun {$9000}\nCombat Shotgun {$10000}\nMicro SMG {$3000}\nMP5 {$4000}\nM4 {$6000}\nCountry Rifle {$6500}\nSniper Rifle {$7000}", "Purchase", "Cancel");
return 1;
}
if(pickupid == breifcase2)
{
ShowPlayerDialog(playerid, 2341, DIALOG_STYLE_LIST, "UDC Base Breifcase Menu", "Health {$2000}\nArmour {$2500}\nDesert Eagle {$3000}\nShotgun {$5000}\nSawn-Off Shotgun {$9000}\nCombat Shotgun {$10000}\nMicro SMG {$3000}\nMP5 {$4000}\nM4 {$6000}\nCountry Rifle {$6500}\nSniper Rifle {$7000}", "Purchase", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2341)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -1500);
SetPlayerHealth(playerid, 100); //Health
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -2500);
SetPlayerArmour(playerid, 100); //Armour
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 2)
{
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid, 24, 200); //Desert Eagle
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 3)
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 25, 200); //Shotgun
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 4)
{
if(GetPlayerMoney(playerid) < 9000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -9000);
GivePlayerWeapon(playerid, 26, 350); //Sawn-off
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 5)
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -10000);
GivePlayerWeapon(playerid, 27, 350); //Combat Shotgun
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 6)
{
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid, 28, 500); //Micro SMG
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 7)
{
if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -4000);
GivePlayerWeapon(playerid, 29, 500); //MP5
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 8)
{
if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -6000);
GivePlayerWeapon(playerid, 31, 200); //M4
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 9)
{
if(GetPlayerMoney(playerid) < 6500) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -6500);
GivePlayerWeapon(playerid, 33, 100); //Country Rifle
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 10)
{
if(GetPlayerMoney(playerid) < 7000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -7000);
GivePlayerWeapon(playerid, 34, 100); //Sniper Rifle
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
}
return 1;
}
return 0;
}
It is only showing briefcase. Not showing Briefcase2 icon.. Whats That. First one is working..
Re: Create Pick Up! Need Help!! -
[MM]RoXoR[FS] - 19.06.2012
Code seems fine, maybe something else is wrong.
PS : Why have put them so high??
Re: Create Pick Up! Need Help!! -
Skaizo - 19.06.2012
you create two dialog with same number and must two dialog with ohter number no same
like this
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == breifcase)
{
ShowPlayerDialog(playerid, 2341, DIALOG_STYLE_LIST, "UDC Base Breifcase Menu", "Health {$2000}\nArmour {$2500}\nDesert Eagle {$3000}\nShotgun {$5000}", "Purchase", "Cancel");
return 1;
}
if(pickupid == breifcase2)
{
ShowPlayerDialog(playerid, 2311, DIALOG_STYLE_LIST, "UDC Base Breifcase Menu", "Sawn-Off Shotgun {$9000}\nCombat Shotgun {$10000}\nMicro SMG {$3000}\nMP5 {$4000}\nM4 {$6000}\nCountry Rifle {$6500}\nSniper Rifle {$7000}", "Purchase", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2341)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -1500);
SetPlayerHealth(playerid, 100); //Health
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -2500);
SetPlayerArmour(playerid, 100); //Armour
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 2)
{
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid, 24, 200); //Desert Eagle
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 3)
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 25, 200); //Shotgun
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
}
}
if(dialogid == 2311)
{
if(response)
{
if(listitem == 4)
{
if(GetPlayerMoney(playerid) < 9000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -9000);
GivePlayerWeapon(playerid, 26, 350); //Sawn-off
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 5)
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -10000);
GivePlayerWeapon(playerid, 27, 350); //Combat Shotgun
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 6)
{
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid, 28, 500); //Micro SMG
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 7)
{
if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -4000);
GivePlayerWeapon(playerid, 29, 500); //MP5
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 8)
{
if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -6000);
GivePlayerWeapon(playerid, 31, 200); //M4
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 9)
{
if(GetPlayerMoney(playerid) < 6500) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -6500);
GivePlayerWeapon(playerid, 33, 100); //Country Rifle
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
if(listitem == 10)
{
if(GetPlayerMoney(playerid) < 7000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
GivePlayerMoney(playerid, -7000);
GivePlayerWeapon(playerid, 34, 100); //Sniper Rifle
GameTextForPlayer(playerid, "~r~iTem ~g~Purchased!", 500, 0);
}
}
}
return 1;
}