Help

Započeo Mr. Kid, Novembar 17, 2009, 23:13:57 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Pozz!

Kako napraviti da kad je igrac u ammunationu da napise /buy i onda ime oruzja i dobije to oruzje?

koristi da napise buy i ime onda da mu uzme novac sa getplayermoney,  i onda

GivePlayerWeapon a sad ti neznam tocno cijelu skriptu :D

======ஜ۩۞۩ஜ======
â—,,███â–"â–' FucK oFFâ–'â–"███►
======ஜ۩۞۩ஜ======



:D Fala kurcu imamo i nekih pametnih ljudi na forumu :D

Posjetite:
TUTORIALS 4 ALL NA HRVATSKOM









To znam. Samo ne znam kako napraviti da kad napise to ime da mu da to oruzje, jer sam uspio da kad napise samo /buy da mu napise "KORISTENJE: /buy <ime_oruzja>. A kad napise npr. /buy m4 ne dobije nista, a stavio sam to u skriptu.

pa getplayermoney i cifru i onda ispod give player weapon i id od m4

======ஜ۩۞۩ஜ======
â—,,███â–"â–' FucK oFFâ–'â–"███►
======ஜ۩۞۩ஜ======



:D Fala kurcu imamo i nekih pametnih ljudi na forumu :D

Posjetite:
TUTORIALS 4 ALL NA HRVATSKOM









turker_kc

Pa trebas napravit "slucajeve"

znaci ako on napise M4 da mu da M4 itd pogledaj kako ti je u GF modu

evo ti jer vidim da nikakve kortisti od tebe :D

if (strcmp(cmd, "/buygun", true) == 0)
{
new gun;
new gunid[16];
new gunstring1[256];
new gunstring2[256];
new gunstring3[256];
new gunstring4[256];
new gunstring5[256];
new infostring[256];
new guncharge;
new ammocharge;
new location = PlayerInfo[playerid][pLocal];
if(location < 99 || location == 255)
{
SendClientMessage(playerid, COLOR_WHITE,"Nisi u trgovini oruzjem");
return 1;
}
new mod = (BizzInfo[location-99][bPriceMod]);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "Pisi: /buygun [gunname] [ammoamount]");
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
SendClientMessage(playerid, COLOR_WHITE,"*** Oruzje i Municija ***");
SendClientMessage(playerid, COLOR_GRAD2,string);
format(gunstring1, 256, "Oruzja: parachute ($%d) golfclub ($%d) nightstick ($%d) knife ($%d) baseballbat ($%d) shovel ($%d) poolcue ($%d)",
GunPrice[0][0]/100*mod,GunPrice[1][0]/100*mod,GunPrice[2][0]/100*mod,GunPrice[3][0]/100*mod,GunPrice[4][0]/100*mod,GunPrice[5][0]/100*mod,GunPrice[6][0]/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring1);
format(gunstring2, 256, "Oruzja: purpledildo ($%d) whitedildo ($%d) longwhitedildo ($%d) whitedildo2 ($%d) flowers ($%d) cane",
GunPrice[7][0]/100*mod,GunPrice[8][0]/100*mod,GunPrice[9][0]/100*mod,GunPrice[10][0]/100*mod,GunPrice[11][0]/100*mod,GunPrice[12][0]/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring2);
format(gunstring3, 256, "Oruzja: sdpistol ($%d) colt45 ($%d) deagle ($%d) tec9 ($%d)  uzi ($%d) mp5 ($%d)",
GunPrice[13][0]/100*mod,GunPrice[14][0]/100*mod,GunPrice[15][0]/100*mod,GunPrice[16][0]/100*mod,GunPrice[17][0]/100*mod,GunPrice[18][0]/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring3);
format(gunstring4, 256, "Oruzja: shotgun ($%d) spas12 ($%d)sawnoff ($%d) ak47 ($%d) m4 ($%d) rifle ($%d)",
GunPrice[19][0]/100*mod,GunPrice[20][0]/100*mod,GunPrice[21][0]/100*mod,GunPrice[22][0]/100*mod,GunPrice[23][0]/100*mod,GunPrice[24][0]/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring4);
format(gunstring5, 256, "Oruzja: pistolammo ($%d) shotgunammo ($%d) smgammo ($%d) assaultammo ($%d) rifleammo ($%d)",
GunPrice[25][0],GunPrice[26][0],GunPrice[27][0],GunPrice[28][0],GunPrice[29][0]);
SendClientMessage(playerid, COLOR_GRAD3, gunstring5);
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
return 1;
}
strmid(gunid, tmp, 0, strlen(cmdtext), 255);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "Pisi: /buygun [gunname] [ammoamount]");
return 1;
}
new ammo = strval(tmp);
if(ammo >= 5000)
{
SendClientMessage(playerid, COLOR_GRAD6, "Ne mozes toliko municije kupiti(max 5000).");
return 1;
}
else
{
if (strcmp(gunid, "parachute", true, strlen(gunid)) == 0)
{
gun = 46;
guncharge = GunPrice[0][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "golfclub", true, strlen(gunid)) == 0)
{
gun = 2;
guncharge = GunPrice[1][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "nightstick", true, strlen(gunid)) == 0)
{
gun = 3;
guncharge = GunPrice[2][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "knife", true, strlen(gunid)) == 0)
{
gun = 4;
guncharge = GunPrice[3][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "baseballbat", true, strlen(gunid)) == 0)
{
gun = 5;
guncharge = GunPrice[4][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "shovel", true, strlen(gunid)) == 0)
{
gun = 6;
guncharge = GunPrice[5][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "poolcue", true, strlen(gunid)) == 0)
{
gun = 7;
guncharge = GunPrice[6][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "purpledildo", true, strlen(gunid)) == 0)
{
gun = 10;
guncharge = GunPrice[7][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "whitedildo", true, strlen(gunid)) == 0)
{
gun = 11;
guncharge = GunPrice[8][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "longwhitedildo", true, strlen(gunid)) == 0)
{
gun = 12;
guncharge = GunPrice[9][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "whitedildo2", true, strlen(gunid)) == 0)
{
gun = 13;
guncharge = GunPrice[10][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "flowers", true, strlen(gunid)) == 0)
{
gun = 14;
guncharge = GunPrice[11][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "cane", true, strlen(gunid)) == 0)
{
gun = 15;
guncharge = GunPrice[12][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "sdpistol", true, strlen(gunid)) == 0)
{
gun = 23;
guncharge = GunPrice[13][0]/100*mod;
ammocharge = GunPrice[25][0]*ammo;
}
else if (strcmp(gunid, "colt45", true, strlen(gunid)) == 0)
{
gun = 22;
guncharge = GunPrice[14][0]/100*mod;
ammocharge = GunPrice[25][0]*ammo;
}
else if (strcmp(gunid, "deagle", true, strlen(gunid)) == 0)
{
gun = 24;
guncharge = GunPrice[15][0]/100*mod;
ammocharge = GunPrice[25][0]*ammo;
}
else if (strcmp(gunid, "Tec9", true, strlen(gunid)) == 0)
{
gun = 32;
guncharge = GunPrice[16][0]/100*mod;
ammocharge = GunPrice[27][0]*ammo;
}
else if (strcmp(gunid, "uzi", true, strlen(gunid)) == 0)
{
gun = 28;
guncharge = GunPrice[17][0]/100*mod;
ammocharge = GunPrice[27][0]*ammo;
}
else if (strcmp(gunid, "mp5", true, strlen(gunid)) == 0)
{
gun = 29;
guncharge = GunPrice[18][0]/100*mod;
ammocharge = GunPrice[27][0]*ammo;
}
else if (strcmp(gunid, "shotgun", true, strlen(gunid)) == 0)
{
gun = 25;
guncharge = GunPrice[19][0]/100*mod;
ammocharge = GunPrice[26][0]*ammo;
}
else if (strcmp(gunid, "spas12", true, strlen(gunid)) == 0)
{
gun = 27;
guncharge = GunPrice[20][0]/100*mod;
ammocharge = GunPrice[26][0]*ammo;
}
else if (strcmp(gunid, "sawnoff", true, strlen(gunid)) == 0)
{
gun = 26;
guncharge = GunPrice[21][0]/100*mod;
ammocharge = GunPrice[26][0]*ammo;
}
else if (strcmp(gunid, "ak47", true, strlen(gunid)) == 0)
{
gun = 30;
guncharge = GunPrice[22][0]/100*mod;
ammocharge = GunPrice[28][0]*ammo;
}
else if (strcmp(gunid, "m4", true, strlen(gunid)) == 0)
{
gun = 31;
guncharge = GunPrice[23][0]/100*mod;
ammocharge = GunPrice[28][0]*ammo;
}
else if (strcmp(gunid, "rifle", true, strlen(gunid)) == 0)
{
gun = 33;
guncharge = GunPrice[24][0]/100*mod;
ammocharge = GunPrice[29][0]*ammo;
}
else
{
SendClientMessage(playerid, COLOR_GRAD6, "Prodavac: nikad nisam cuo za oruzje koje se tako zove.");
return 1;
}
}
if((guncharge+ammocharge) > GetPlayerMoney(playerid))
{
format(infostring, 256, "Nemas $%d",guncharge+ammocharge);
SendClientMessage(playerid, COLOR_GRAD3, infostring);
return 1;
}
format(infostring, 256, "Kupio si %s s %d municije za $%d",gunid,ammo,guncharge+ammocharge);
SendClientMessage(playerid, COLOR_GRAD3, infostring);
GivePlayerMoney(playerid,-(guncharge+ammocharge));
BizzInfo[location-99][bTakings] = BizzInfo[location-99][bTakings]+(guncharge+ammocharge);
BizzInfo[location-99][bProd]--;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
GivePlayerWeapon(playerid, gun, ammo);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s je kupio oruzje $%d u bizu%d", sendername, (guncharge+ammocharge), location-99);
printf("%s", string);
PayLog(string);
return 1;
}


ali ovo niej jedino kako da se treba napraviti ima jos neki puno laksi slucaj, a to je da imas 100 komandei /buy m4 pa onda /buy .... i za svaki radis posebno :D

======ஜ۩۞۩ஜ======
â—,,███â–"â–' FucK oFFâ–'â–"███►
======ஜ۩۞۩ஜ======



:D Fala kurcu imamo i nekih pametnih ljudi na forumu :D

Posjetite:
TUTORIALS 4 ALL NA HRVATSKOM









Ok, hvala. To cu ja jos malo editat da mi pase.

nista :D

======ஜ۩۞۩ஜ======
â—,,███â–"â–' FucK oFFâ–'â–"███►
======ஜ۩۞۩ஜ======



:D Fala kurcu imamo i nekih pametnih ljudi na forumu :D

Posjetite:
TUTORIALS 4 ALL NA HRVATSKOM









r4z0r