Skripta koju koristim:LARP edit
Detaljan opis problema:Evo kad koristim komandu /get fuel, izbaci mi samo "You filled your Gas Can for 20% for 0$... to je prvi problem sto ne uzima pare, a drugi problem je kad ocu /fill, pise mi da nemam dovoljno goriva u balonu sa gorivom.... Neznam kako fix sam pa trazim pomoc...
Dio skripte:
if(strcmp(cmd,"/get",true)==0)
{
if(IsPlayerConnected(playerid))
{
new x_job[256];
x_job = strtok(cmdtext, idx);
if(!strlen(x_job)) {
SendClientMessage(playerid, COLOR_WHITE, "|__________________ Get __________________|");
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /get [ime]");
SendClientMessage(playerid, COLOR_GREY, "Dostupna imena: Droga, Fuel");
SendClientMessage(playerid, COLOR_GREEN, "|_________________________________________|");
return 1;
}
if(strcmp(x_job,"droga",true) == 0)
{
if(PlayerInfo[playerid][pDrugs] > 15)
{
format(string, sizeof(string), " You still have %d grams with you, sell them first !", PlayerInfo[playerid][pDrugs]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
new tel;
new price;
new ammount;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /get drugs [ammount]");
return 1;
}
new level = PlayerInfo[playerid][pDrugsSkill];
ammount = strval(tmp);
if(level >= 0 && level <= 50)
{ tel = 200; if(ammount < 1 || ammount > 6) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 6 at your Skill Level!"); return 1; } }
else if(level >= 51 && level <= 100)
{ tel = 150; if(ammount < 1 || ammount > 12) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 12 at your Skill Level!"); return 1; } }
else if(level >= 101 && level <= 200)
{ tel = 100; if(ammount < 1 || ammount > 20) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 20 at your Skill Level!"); return 1; } }
else if(level >= 201 && level <= 400)
{ tel = 50; if(ammount < 1 || ammount > 30) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 30 at your Skill Level!"); return 1; } }
else if(level >= 401)
{ tel = 10; if(ammount < 1 || ammount > 99) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 99 at your Skill Level!"); return 1; } }
if (PlayerInfo[playerid][pJob] == 4 && PlayerToPoint(2.0, playerid, 323.0342,1118.5804,1083.8828))
{
price = ammount * tel;
if(GetPlayerMoney(playerid) > price)
{
format(string, sizeof(string), "* Kupio si %d grama za $%d.", ammount, price);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SafeJB_GivePlayerMoney(playerid, -price);
PlayerInfo[playerid][pDrugs] = ammount;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nemozes priustiti drogu !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nisi diler droge ili nisi kod Crackers house !");
return 1;
}
}
else if(strcmp(x_job,"fuel",true) == 0)
{
if(IsAtGasStation(playerid))
{
new price = 20 * SBizzInfo[3][sbEntranceCost];
format(string, sizeof(string), "* Napunio si svoj balon sa gorivom za 20% po cijeni od $%d",price);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerInfo[playerid][pFuel] = 20;
SafeJB_GivePlayerMoney(playerid, - price);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GREY," Nisi kod benzinske stanice!");
return 1;
}
}
else { return 1; }
}//not connected
return 1;
}
if(strcmp(cmd, "/fill", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFuel] > 0)
{
if(Gas[gLastCar[playerid]] < 81)
{
SendClientMessage(playerid, COLOR_WHITE, " Dopunili ste vase vozilo sa 20 posto goriva iz vaseg balona sa gorivom.");
Gas[gLastCar[playerid]] += 20;
PlayerInfo[playerid][pFuel] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vas auto ima dovoljno goriva ,tako da mozete nastaviti voznju !");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nemate dovoljno goriva u vasem kanisteru sa gorivom !");
}
}
return 1;
}
Probaj if(strcmp(cmd,"/get",true)==0)
{
if(IsPlayerConnected(playerid))
{
new x_job[256];
x_job = strtok(cmdtext, idx);
if(!strlen(x_job)) {
SendClientMessage(playerid, COLOR_WHITE, "|__________________ Get __________________|");
SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /get [ime]");
SendClientMessage(playerid, COLOR_GREY, "Dostupna imena: Droga Fuel");
SendClientMessage(playerid, COLOR_GREEN, "|_________________________________________|");
return 1;
}
if(strcmp(x_job,"droga",true) == 0)
{
if(PlayerInfo[playerid][pDrugs] > 15)
{
format(string, sizeof(string), " You still have %d grams with you, sell them first !", PlayerInfo[playerid][pDrugs]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
new tel;
new price;
new ammount;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /get drugs [kolicina]");
return 1;
}
new level = PlayerInfo[playerid][pDrugsSkill];
ammount = strval(tmp);
if(level >= 0 && level <= 50)
{ tel = 200; if(ammount < 1 || ammount > 6) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 6 at your Skill Level!"); return 1; } }
else if(level >= 51 && level <= 100)
{ tel = 150; if(ammount < 1 || ammount > 12) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 12 at your Skill Level!"); return 1; } }
else if(level >= 101 && level <= 200)
{ tel = 100; if(ammount < 1 || ammount > 20) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 20 at your Skill Level!"); return 1; } }
else if(level >= 201 && level <= 400)
{ tel = 50; if(ammount < 1 || ammount > 30) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 30 at your Skill Level!"); return 1; } }
else if(level >= 401)
{ tel = 10; if(ammount < 1 || ammount > 99) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 99 at your Skill Level!"); return 1; } }
if (PlayerInfo[playerid][pJob] == 4 && PlayerToPoint(2.0, playerid, 1488.6949,-1721.7136,8.2067))
{
price = ammount * tel;
if(GetPlayerMoney(playerid) > price)
{
format(string, sizeof(string), "* Kupio si %d grama za $%d.", ammount, price);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SafeGivePlayerMoney(playerid, -price);
PlayerInfo[playerid][pDrugs] = ammount;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Ne mozete priustiti drogu !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Niste diler droge ili niste na Crnom Trzistu !");
return 1;
}
}
if(strcmp(x_job,"fuel",true) == 0)
{
if(IsAtGasStation(playerid))
{
new price = 20 * SBizzInfo[3][sbEntranceCost];
format(string, sizeof(string), "* Napunili ste kanister sa 20% goriva za $%d",price);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerInfo[playerid][pFuel] = 20;
SafeGivePlayerMoney(playerid, - price);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GREY," Niste na Pumpi!");
return 1;
}
}
else { return 1; }
}//not connected
return 1;
}
ovo za get fuel je postavio ovo na neku cijenu sbEntranceCost
jer ako je to nula, on mnozi dvadeset sa nula i ispadne nula..
a ovo fill stavi ovako
if(strcmp(cmd, "/fill", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFuel] < 0)
{
if(Gas[gLastCar[playerid]] < 81)
{
SendClientMessage(playerid, COLOR_WHITE, " Dopunili ste vase vozilo sa 20 posto goriva iz vaseg balona sa gorivom.");
Gas[gLastCar[playerid]] += 20;
PlayerInfo[playerid][pFuel] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vas auto ima dovoljno goriva ,tako da mozete nastaviti voznju !");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nemate dovoljno goriva u vasem kanisteru sa gorivom !");
}
}
return 1;
}
nece nijedno ni drugo, svejedno pise nemate dovoljno goriva u kanistru :/
if(strcmp(cmd, "/fill", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFuel] > 0)
{
if(Gas[gLastCar[playerid]] <= 81)
{
Gas[gLastCar[playerid]] += 20;
PlayerInfo[playerid][pFuel] = 0;
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Re-Rezervoar se puni, sacekajte",2000,3);
SetTimer("Fillup",RefuelWait,0);
Refueling[playerid] = 1;
}
else
{
GameTextForPlayer(playerid,"~r~~n~~n~~n~~n~~n~~n~~n~~n~~n~Kanister je pun",2000,3);
}
}
else
{
SendClientMessage(playerid,COLOR_GREY," Niste na Pumpi!");
}
}
return 1;
}
Sada mi stalno pise niste na pumpi.....
BUMP... nije jos popravljeno :/
Ako nisi sta editao,za to ti je default komanda /fillcar sa kanisterom za gorivo..
BUMP!