08.02.2010, 22:00
ok so i started to make a drug dealing system for my server that works like this .Players do /drughouse to go to the drughouse then once inside i have a pickup icon you walk into and it brings you to the drug menu where you buy drugs im wondering how i could make a /stash command to see how many grams you got and a /sell id amount price to sell the drugs after you bought them for more. Here is what i got so far i code in dcmd so if you could help me that would be great
new weed[MAX_PLAYERS];
new coke[MAX_PLAYERS];
new crack[MAX_PLAYERS];
new hash1[MAX_PLAYERS];
new heroin[MAX_PLAYERS];
new tobbacco[MAX_PLAYERS];
new extacy[MAX_PLAYERS];
new lsd[MAX_PLAYERS];
new acid[MAX_PLAYERS];
new weedpickup;
weedpickup = CreatePickup(1241, 2, 319.5118,1120.9940,1083.882;
if (pickupid ==weedpickup)
{
ShowPlayerDialog(playerid, DIALOGID+100, DIALOG_STYLE_LIST, "Drugs", "Weed\nCoke\nCrack\nHash\nHeroin\nTobbacco\nExtacy \nLsd\nAcid", "Select", "Cancel");
}
if(dialogid == DIALOGID+100) // drugs
{
if(response)
{
if(listitem == 0)// Weed
{
if(GetPlayerMoney(playerid) >= 2600){
GivePlayerMoney(playerid, -2600);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Weed For $2600 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
weed[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Weed cost $2600 A Pound");
return 1;
}
if(listitem == 1)// Coke
{
if(GetPlayerMoney(playerid) >= 4600){
GivePlayerMoney(playerid, -4600);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Coke For $4600 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
coke[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Coke cost $4600 A Pound");
return 1;
}
if(listitem == 2)// Crack
{
if(GetPlayerMoney(playerid) >= 5600){
GivePlayerMoney(playerid, -5600);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Crack For $5600 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
crack[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Crack cost $5600 A Pound");
return 1;
}
if(listitem == 3)// Hash
{
if(GetPlayerMoney(playerid) >= 3000){
GivePlayerMoney(playerid, -3000);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Hash For $3000 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
hash1[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Hash cost $3000 A Pound");
return 1;
}
if(listitem == 4)// Heroin
{
if(GetPlayerMoney(playerid) >= 7000){
GivePlayerMoney(playerid, -7000);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Heroin For $7000 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
heroin[playerid] = 500;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Heroin cost $7000 A Pound");
return 1;
}
if(listitem == 5)// Tobbacco
{
if(GetPlayerMoney(playerid) >= 400){
GivePlayerMoney(playerid, -400);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Tobbacco For $400 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
tobbacco[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Tobbacco cost $400 A Pound");
return 1;
}
if(listitem == 6)// Extacy
{
if(GetPlayerMoney(playerid) >= 2000){
GivePlayerMoney(playerid, -2000);
GameTextForPlayer(playerid, "~w~] You Just Bought 200 Pills Of Extacy For $2000 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
extacy[playerid] = 200;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Extacy cost $2000 For 200 Pills");
return 1;
}
if(listitem == 7)// Lsd
{
if(GetPlayerMoney(playerid) >= 6500){
GivePlayerMoney(playerid, -6500);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Lsd For $6500 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
lsd[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Lsd cost $6500 A Pound");
return 1;
}
if(listitem == // Acid
{
if(GetPlayerMoney(playerid) >= 1000){
GivePlayerMoney(playerid, -1000);
GameTextForPlayer(playerid, "~w~] You Just Bought A Sheet Of Acid For $1000 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
acid[playerid] = 500;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Acid cost $1000 A Sheet");
return 1;
}
return 1;
}
}
new weed[MAX_PLAYERS];
new coke[MAX_PLAYERS];
new crack[MAX_PLAYERS];
new hash1[MAX_PLAYERS];
new heroin[MAX_PLAYERS];
new tobbacco[MAX_PLAYERS];
new extacy[MAX_PLAYERS];
new lsd[MAX_PLAYERS];
new acid[MAX_PLAYERS];
new weedpickup;
weedpickup = CreatePickup(1241, 2, 319.5118,1120.9940,1083.882;
if (pickupid ==weedpickup)
{
ShowPlayerDialog(playerid, DIALOGID+100, DIALOG_STYLE_LIST, "Drugs", "Weed\nCoke\nCrack\nHash\nHeroin\nTobbacco\nExtacy \nLsd\nAcid", "Select", "Cancel");
}
if(dialogid == DIALOGID+100) // drugs
{
if(response)
{
if(listitem == 0)// Weed
{
if(GetPlayerMoney(playerid) >= 2600){
GivePlayerMoney(playerid, -2600);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Weed For $2600 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
weed[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Weed cost $2600 A Pound");
return 1;
}
if(listitem == 1)// Coke
{
if(GetPlayerMoney(playerid) >= 4600){
GivePlayerMoney(playerid, -4600);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Coke For $4600 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
coke[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Coke cost $4600 A Pound");
return 1;
}
if(listitem == 2)// Crack
{
if(GetPlayerMoney(playerid) >= 5600){
GivePlayerMoney(playerid, -5600);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Crack For $5600 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
crack[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Crack cost $5600 A Pound");
return 1;
}
if(listitem == 3)// Hash
{
if(GetPlayerMoney(playerid) >= 3000){
GivePlayerMoney(playerid, -3000);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Hash For $3000 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
hash1[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Hash cost $3000 A Pound");
return 1;
}
if(listitem == 4)// Heroin
{
if(GetPlayerMoney(playerid) >= 7000){
GivePlayerMoney(playerid, -7000);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Heroin For $7000 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
heroin[playerid] = 500;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Heroin cost $7000 A Pound");
return 1;
}
if(listitem == 5)// Tobbacco
{
if(GetPlayerMoney(playerid) >= 400){
GivePlayerMoney(playerid, -400);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Tobbacco For $400 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
tobbacco[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Tobbacco cost $400 A Pound");
return 1;
}
if(listitem == 6)// Extacy
{
if(GetPlayerMoney(playerid) >= 2000){
GivePlayerMoney(playerid, -2000);
GameTextForPlayer(playerid, "~w~] You Just Bought 200 Pills Of Extacy For $2000 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
extacy[playerid] = 200;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Extacy cost $2000 For 200 Pills");
return 1;
}
if(listitem == 7)// Lsd
{
if(GetPlayerMoney(playerid) >= 6500){
GivePlayerMoney(playerid, -6500);
GameTextForPlayer(playerid, "~w~] You Just Bought A Pound Of Lsd For $6500 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
lsd[playerid] = 453;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Lsd cost $6500 A Pound");
return 1;
}
if(listitem == // Acid
{
if(GetPlayerMoney(playerid) >= 1000){
GivePlayerMoney(playerid, -1000);
GameTextForPlayer(playerid, "~w~] You Just Bought A Sheet Of Acid For $1000 ]", 5000, 5);
ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0, 0,0,0,0);
acid[playerid] = 500;
}
else return SendClientMessage(playerid, blue, "You do not have enough money, Acid cost $1000 A Sheet");
return 1;
}
return 1;
}
}