Započeo Tomislav_Furlic
•6. Jul 2014.• Zaključano[POMOC] /loadheroin /sellheroin
224
pregleda
5
postova
Rookie
Balkan SA:MP
Balkan SA:MPNovi Član
65 / 100 XP
Početnik(0)
6
Postovi:
3
Teme:
Pridružio se:Jun 2014
6. Jul 2014.
Editujem: Raven's Roleplay
Opis problema: Zelim napraviti komande /loadheroin i /sellheroin. Mislim da kada netko na odredjenom mjestu upise /loadheroin dobije ga u kamion/prikolicu a kada dodje na drugo mjesto i upise /sellheroin dobije novac... Ja sam to pokusao ali kada upisem /sellheroin mogu ga prodati u bilo koje vrijeme ne moram ici prvo /loadheroin. Molim vas pomoc
Dio Skripte:
if(strcmp(cmd, "/loadheroin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
if(PlayerToPoint(70.0, playerid, -2169.3203,-217.4825,35.3203))
{
if(GetVehicleModel(tmpcar) == 499 || GetVehicleModel(tmpcar) == 482 || GetVehicleModel(tmpcar) == 498 || GetVehicleModel(tmpcar) == 609 || GetVehicleModel(tmpcar) == 403 || GetVehicleModel(tmpcar) == 414 || GetVehicleModel(tmpcar) == 514 || GetVehicleModel(tmpcar) == 413 || GetVehicleModel(tmpcar) == 515 || GetVehicleModel(tmpcar) == 440 || GetVehicleModel(tmpcar) == 459 || GetVehicleModel(tmpcar) == 456 || GetVehicleModel(tmpcar) == 435 || GetVehicleModel(tmpcar) == 591)
{
if(PlayerInfo < 300)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "INFO: /loadheroin ");
return 1;
}
new amount = strval(tmp);
if(amount < 1 || amount > 300) { SendClientMessage(playerid, COLOR_GREY, " Can't buy less then 1 heroin or more then 300 !"); return 1; }
new cost = amount*25;
if(GetPlayerMoney(playerid) > cost)
{
SetPVarInt(playerid,"Heroin",1);
PlayerInfo += amount;
format(string, sizeof(string), "You bought %d heroin for $%d.", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SafeGivePlayerMoney(playerid,-cost);
return 1;
}
else
{
format(string, sizeof(string), "You cant afford %d heroin at $%d !", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Heroin: %d/%d.", LoadedHeroin,LoadedHeroin);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "This Vehicle does not deliver Heroin.");
return 1;
}
}
}
return 1;
}
if(strcmp(cmd, "/sellheroin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
if(PlayerToPoint(70.0, playerid, 1751.5300,-2055.2219,13.9722))
{
if(GetVehicleModel(tmpcar) == 499 || GetVehicleModel(tmpcar) == 482 || GetVehicleModel(tmpcar) == 498 || GetVehicleModel(tmpcar) == 609 || GetVehicleModel(tmpcar) == 403 || GetVehicleModel(tmpcar) == 414 || GetVehicleModel(tmpcar) == 514 || GetVehicleModel(tmpcar) == 413 || GetVehicleModel(tmpcar) == 515 || GetVehicleModel(tmpcar) == 440 || GetVehicleModel(tmpcar) == 459 || GetVehicleModel(tmpcar) == 456 || GetVehicleModel(tmpcar) == 435 || GetVehicleModel(tmpcar) == 591)
{
if(PlayerInfo < 300)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "INFO: /sellheroin ");
return 1;
}
new amount = strval(tmp);
if(amount < 1 || amount > 300) { SendClientMessage(playerid, COLOR_GREY, " Can't sell less then 1 heroin or more then 300 !"); return 1; }
new cost = amount*50;
if(GetPlayerMoney(playerid) > cost)
{
if(GetPVarInt(playerid,"Heroin") == 1)
if(GetPVarInt(playerid,"Heroin") == 1)
PlayerInfo += amount;
format(string, sizeof(string), "You sell %d heroin for $%d.", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SafeGivePlayerMoney(playerid,cost);
SetPVarInt(playerid,"Heroin",0);
return 1;
}
else
{
format(string, sizeof(string), "You cant sell %d heroin at $%d !", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Heroin: %d/%d.", LoadedHeroin,LoadedHeroin);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "This Vehicle does not deliver Heroin.");
return 1;
}
}
}
return 1;
}
Opis problema: Zelim napraviti komande /loadheroin i /sellheroin. Mislim da kada netko na odredjenom mjestu upise /loadheroin dobije ga u kamion/prikolicu a kada dodje na drugo mjesto i upise /sellheroin dobije novac... Ja sam to pokusao ali kada upisem /sellheroin mogu ga prodati u bilo koje vrijeme ne moram ici prvo /loadheroin. Molim vas pomoc
Dio Skripte:
if(strcmp(cmd, "/loadheroin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
if(PlayerToPoint(70.0, playerid, -2169.3203,-217.4825,35.3203))
{
if(GetVehicleModel(tmpcar) == 499 || GetVehicleModel(tmpcar) == 482 || GetVehicleModel(tmpcar) == 498 || GetVehicleModel(tmpcar) == 609 || GetVehicleModel(tmpcar) == 403 || GetVehicleModel(tmpcar) == 414 || GetVehicleModel(tmpcar) == 514 || GetVehicleModel(tmpcar) == 413 || GetVehicleModel(tmpcar) == 515 || GetVehicleModel(tmpcar) == 440 || GetVehicleModel(tmpcar) == 459 || GetVehicleModel(tmpcar) == 456 || GetVehicleModel(tmpcar) == 435 || GetVehicleModel(tmpcar) == 591)
{
if(PlayerInfo < 300)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "INFO: /loadheroin ");
return 1;
}
new amount = strval(tmp);
if(amount < 1 || amount > 300) { SendClientMessage(playerid, COLOR_GREY, " Can't buy less then 1 heroin or more then 300 !"); return 1; }
new cost = amount*25;
if(GetPlayerMoney(playerid) > cost)
{
SetPVarInt(playerid,"Heroin",1);
PlayerInfo += amount;
format(string, sizeof(string), "You bought %d heroin for $%d.", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SafeGivePlayerMoney(playerid,-cost);
return 1;
}
else
{
format(string, sizeof(string), "You cant afford %d heroin at $%d !", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Heroin: %d/%d.", LoadedHeroin,LoadedHeroin);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "This Vehicle does not deliver Heroin.");
return 1;
}
}
}
return 1;
}
if(strcmp(cmd, "/sellheroin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
if(PlayerToPoint(70.0, playerid, 1751.5300,-2055.2219,13.9722))
{
if(GetVehicleModel(tmpcar) == 499 || GetVehicleModel(tmpcar) == 482 || GetVehicleModel(tmpcar) == 498 || GetVehicleModel(tmpcar) == 609 || GetVehicleModel(tmpcar) == 403 || GetVehicleModel(tmpcar) == 414 || GetVehicleModel(tmpcar) == 514 || GetVehicleModel(tmpcar) == 413 || GetVehicleModel(tmpcar) == 515 || GetVehicleModel(tmpcar) == 440 || GetVehicleModel(tmpcar) == 459 || GetVehicleModel(tmpcar) == 456 || GetVehicleModel(tmpcar) == 435 || GetVehicleModel(tmpcar) == 591)
{
if(PlayerInfo < 300)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "INFO: /sellheroin ");
return 1;
}
new amount = strval(tmp);
if(amount < 1 || amount > 300) { SendClientMessage(playerid, COLOR_GREY, " Can't sell less then 1 heroin or more then 300 !"); return 1; }
new cost = amount*50;
if(GetPlayerMoney(playerid) > cost)
{
if(GetPVarInt(playerid,"Heroin") == 1)
if(GetPVarInt(playerid,"Heroin") == 1)
PlayerInfo += amount;
format(string, sizeof(string), "You sell %d heroin for $%d.", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SafeGivePlayerMoney(playerid,cost);
SetPVarInt(playerid,"Heroin",0);
return 1;
}
else
{
format(string, sizeof(string), "You cant sell %d heroin at $%d !", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Heroin: %d/%d.", LoadedHeroin,LoadedHeroin);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "This Vehicle does not deliver Heroin.");
return 1;
}
}
}
return 1;
}
Enforcer
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
40 / 100 XP
Početnik(0)
326
Postovi:
4
Teme:
Pridružio se:Nov. 2013
Rookie
Balkan SA:MP
Balkan SA:MPNovi Član
65 / 100 XP
Početnik(0)
6
Postovi:
3
Teme:
Pridružio se:Jun 2014
Forum Don
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
7,407
Postovi:
93
Teme:
Pridružio se:Nov. 2011
6. Jul 2014.
Vidim da si nov, pa cu ti dati vremena da se iskupis
Vidis, da si procitao pravila vido bi da je obavezno staviti prefix ispred naslova teme, u zavisnosti da li ti treba pomoc ili savet, tako da te molim da ucinis tako i procitas pravila kada si vec tu 🙂
Vidis, da si procitao pravila vido bi da je obavezno staviti prefix ispred naslova teme, u zavisnosti da li ti treba pomoc ili savet, tako da te molim da ucinis tako i procitas pravila kada si vec tu 🙂
Rookie
Balkan SA:MP
Balkan SA:MPNovi Član
65 / 100 XP
Početnik(0)
6
Postovi:
3
Teme:
Pridružio se:Jun 2014
6. Jul 2014.
Hvala [CH😄M]Lenon, ali opet kada kupim "heroin" i idem ga prodat u chat mi izbaci Heroin 0/0 ali ne dobijem novac.
Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava