Skripta : Moja
Problem : Kako da prebacim iz jednog moda u drugi gun shop ? Je li samo komandu /buygun i nista vise ?
Slike://
[POMOC] Gun Shop
Započeo Obrisan korisnik
•20. Mar. 2012.• Zaključano536
pregleda
9
postova
20. Mar. 2012.
20. Mar. 2012.
Mozes da mi kazes sve to sta treba , znam da treba , new gunprice,/buygun , sta jos ?
20. Mar. 2012.
Evo ti komanda za kupovinu:
Samo postavi svoje koordinate PlayerToPoint-a!
Samo postavi svoje koordinate PlayerToPoint-a!
if (strcmp(cmd, "/buygun", true) == 0 || strcmp(cmd, "/kupioruzije", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerMoney(playerid) < 1)
{
SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca kod sebe !");
return 1;
}
new gun;
new gunid;
new gunstring3;
new gunstring4;
new infostring;
new guncharge;
new ammocharge;
new location = PlayerInfo;
if(PlayerToPoint(20.0,playerid,x, z, z)) //Tvoje koordinate
{
new mod = 100;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "Koristenje: /kupioruzije [ime oruzija] ");
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
SendClientMessage(playerid, COLOR_WHITE,"*** Oruzije & Municija ***");
SendClientMessage(playerid, COLOR_GRAD2,string);
format(gunstring3, 256, "Oruzije: sdpistolj ($%d) dezert ($%d) tec9 ($%d) uzi ($%d) hekler ($%d)",
GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring3);
format(gunstring4, 256, "Oruzije: pumparica ($%d) kalas ($%d) m4 ($%d) puska ($%d) snajper ($15000)",
GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod,GunPrice/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring4);
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
return 1;
}
strmid(gunid, tmp, 0, strlen(cmdtext), 255);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "Koriscenje: /kupioruzije [ime oruzija] ");
return 1;
}
new ammo = strval(tmp);
if(ammo < 1 || ammo > 999) { SendClientMessage(playerid, COLOR_GREY, " Kolicina municije ne smije biti ispod 1 ni veca od 999 !"); return 1; }
if (strcmp(gunid, "parachute", true, strlen(gunid)) == 0)
{
gun = 46;
guncharge = GunPrice/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "golfclub", true, strlen(gunid)) == 0)
{
gun = 2; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 2; PlayerInfo = 1;
}
else if (strcmp(gunid, "nightstick", true, strlen(gunid)) == 0)
{
gun = 3; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 3; PlayerInfo = 1;
}
else if (strcmp(gunid, "baseballbat", true, strlen(gunid)) == 0)
{
gun = 5; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 5; PlayerInfo = 1;
}
else if (strcmp(gunid, "shovel", true, strlen(gunid)) == 0)
{
gun = 6; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 6; PlayerInfo = 1;
}
else if (strcmp(gunid, "poolcue", true, strlen(gunid)) == 0)
{
gun = 7; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 7; PlayerInfo = 1;
}
else if (strcmp(gunid, "purpledildo", true, strlen(gunid)) == 0)
{
gun = 10; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 10; PlayerInfo = 1;
}
else if (strcmp(gunid, "whitedildo", true, strlen(gunid)) == 0)
{
gun = 11; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 11; PlayerInfo = 1;
}
else if (strcmp(gunid, "longwhitedildo", true, strlen(gunid)) == 0)
{
gun = 12; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 12; PlayerInfo = 1;
}
else if (strcmp(gunid, "whitedildo2", true, strlen(gunid)) == 0)
{
gun = 13; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 13; PlayerInfo = 1;
}
else if (strcmp(gunid, "flowers", true, strlen(gunid)) == 0)
{
gun = 14; guncharge = GunPrice/100*mod; ammocharge = 0;
//PlayerInfo = 14; PlayerInfo = 1;
}
else if (strcmp(gunid, "sdpistolj", true, strlen(gunid)) == 0)
{
gun = 23; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 23; PlayerInfo = ammo;
}
else if (strcmp(gunid, "dezert", true, strlen(gunid)) == 0)
{
gun = 24; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 24; PlayerInfo = ammo;
}
else if (strcmp(gunid, "tec9", true, strlen(gunid)) == 0)
{
gun = 32; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 33; PlayerInfo = ammo;
}
else if (strcmp(gunid, "uzi", true, strlen(gunid)) == 0)
{
gun = 28; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 33; PlayerInfo = ammo;
}
else if (strcmp(gunid, "hekler", true, strlen(gunid)) == 0)
{
gun = 29; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 29; PlayerInfo = ammo;
}
else if (strcmp(gunid, "pumparica", true, strlen(gunid)) == 0)
{
gun = 25; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 25; PlayerInfo = ammo;
}
else if (strcmp(gunid, "kalas", true, strlen(gunid)) == 0)
{
gun = 30; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 30; PlayerInfo = ammo;
}
else if (strcmp(gunid, "m4", true, strlen(gunid)) == 0)
{
gun = 31; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 31; PlayerInfo = ammo;
}
else if (strcmp(gunid, "puska", true, strlen(gunid)) == 0)
{
gun = 33; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 33; PlayerInfo = ammo;
}
else if (strcmp(gunid, "snajper", true, strlen(gunid)) == 0)
{
gun = 34; guncharge = GunPrice/100*mod; ammocharge = GunPrice*ammo;
//PlayerInfo = 33; PlayerInfo = ammo;
}
else
{
SendClientMessage(playerid, COLOR_GRAD6, "Prodavac: Nikada nisam cuo za to oruzije.");
return 1;
}
if((guncharge+ammocharge) > GetPlayerMoney(playerid))
{
format(infostring, 256, " Nemate $%d !",guncharge+ammocharge);
SendClientMessage(playerid, COLOR_GRAD3, infostring);
return 1;
}
if(GetPlayerMoney(playerid) < (guncharge+ammocharge))
{
SendClientMessage(playerid, COLOR_GREY, "Ne mozete priustiti to !");
return 1;
}
new payout = guncharge + ammocharge;
format(infostring, 256, "Kupili ste %s sa %d municije za $%d",gunid,ammo,payout);
SendClientMessage(playerid, COLOR_GRAD3, infostring);
if(location == 102 && IsACop(playerid)) { }
else { SafeGivePlayerMoney(playerid, - payout); }
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SafeGivePlayerWeapon(playerid, gun, ammo);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s je kupio oruzije za $%d u %d", sendername, payout, location-99);
}
else
{
SendClientMessage(playerid, COLOR_WHITE,"Niste u prodavnici.");
return 1;
}
}
return 1;
}20. Mar. 2012.
King554 wrote on March 20, 2012, 10:23 am:
Koordinate stavljam u gunshop ili ispred?
if(PlayerToPoint(20.0,playerid,x, y, z)) //Tvoje koordinateOvo su ti PlayerToPoint koordinate u komandi, samo postavi svoje koordinate.
Ovaj broj 20.0 u funkciji odredjuje daljinu (metražu).
Inace PlayerToPoint odredjuje udaljenost za koristenje odredjene komande/funkcije ...
20. Mar. 2012.
Pa brate otkud mi te kordinate moram sa /save , ali brate gde da ih sacuvam ?!!!?!!?!?
20. Mar. 2012.
AddPlayerClass(288,2173.9124,1618.9165,999.9766,269.8154,0,0,0,0,0,0); // gunshop 2
Kako to da prebacim sada u PlayerToPoint
😕
Kako to da prebacim sada u PlayerToPoint
😕
20. Mar. 2012.
King554 wrote on March 20, 2012, 10:37 am:
AddPlayerClass(288,2173.9124,1618.9165,999.9766,269.8154,0,0,0,0,0,0); // gunshop 2
Kako to da prebacim sada u PlayerToPoint
😕
Kako to da prebacim sada u PlayerToPoint
😕
Ovako, iz AddPlayerClass izvadis ove koordinate:
2173.9124,1618.9165,999.9766Znaci, ovako:
if(PlayerToPoint(20.0,playerid, 2173.9124,1618.9165,999.9766)) Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava