Skripta koju koristim:UnderPoint Rp raden od nule
Detaljan opis problema:Treba mi /sellgun kod to jest da mi date sellgun komandu celu.Ali da mozes samo igrac koji je u mafiji da kuca /sellgun.Treba mi deo te skripte.hVALA
Dio skripte:/sellgun
Neke slike/video za lakse dobivanje pomoci(neobavezno):
[POMOC]Sellgun
229
pregleda
3
postova
30. Sep. 2013.
Definiši sve što ti bude potrebno.
COMMAND:sellgun(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new idx, tmp, string, giveplayerid;
if (PlayerInfo != 9)
{
SendClientMessage(playerid,COLOR_GREY,"Niste diler oruzija.");
return 1;
}
new x_weapon,weapon,ammo,price;
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, ""ORANGE"KORISTI: "WHITE"/sellgun ");
SendClientMessage(playerid, COLOR_GREY, "Oruzija: knife(100) bat(100) flowers(25) sdpistol(100) eagle(150)");
SendClientMessage(playerid, COLOR_GREY, "Oruzija: mp5(200) shotgun(200) ak47(600) m4(600) rifle (600)");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
x_weapon = strtok(params, idx);
if(!strlen(x_weapon))
{
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
SendClientMessage(playerid, COLOR_WHITE, "*** Prodaja Oruzija ***");
SendClientMessage(playerid, COLOR_GREY, ""ORANGE"KORISTI: "WHITE"/sellgun ");
SendClientMessage(playerid, COLOR_GREY, "Oruzija: knife(100) bat(100) flowers(25) sdpistol(100) eagle(200)");
SendClientMessage(playerid, COLOR_GREY, "Oruzija: mp5(200) shotgun(200) ak47(600) m4(600) rifle(600)");
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
return 1;
}
}
if(strcmp(x_weapon,"knife",true) == 0) { if(PlayerInfo > 99) { weapon = 4; price = 100; ammo = 1; } else { SendClientMessage(playerid,COLOR_GREY,"Nemate dovoljno materijala za to oruzije."); return 1; } }
else if(strcmp(x_weapon,"bat",true) == 0) { if(PlayerInfo > 99) { weapon = 5; price = 100; ammo = 1; } else { SendClientMessage(playerid,COLOR_GREY,"Nemate dovoljno materijala za to oruzije."); return 1; } }
else if(strcmp(x_weapon,"sdpistol",true) == 0) { if(PlayerInfo > 99) { weapon = 23; price = 100; ammo = 50; } else { SendClientMessage(playerid,COLOR_GREY,"Nemate dovoljno materijala za to oruzije."); return 1; } }
else if(strcmp(x_weapon,"flowers",true) == 0) { if(PlayerInfo > 24) { weapon = 14; price = 25; ammo = 1; } else { SendClientMessage(playerid,COLOR_GREY,"Nemate dovoljno materijala za to oruzije."); return 1; } }
else if(strcmp(x_weapon,"eagle",true) == 0) { if(PlayerInfo > 199) { weapon = 24; price = 150; ammo = 50; } else { SendClientMessage(playerid,COLOR_GREY,"Nemate dovoljno materijala za to oruzije."); return 1; } }
else if(strcmp(x_weapon,"mp5",true) == 0) { if(!PlayerToPoint(15.0,playerid,1484.3933,-1731.2124,6.7213)) { SendClientMessage(playerid, COLOR_GREY, "Ovo oruzije mozete da prodate samo na Crnom Trzistu."); return 1; } if(PlayerInfo > 199) { weapon = 29; price = 200; ammo = 200; } else { SendClientMessage(playerid,COLOR_GREY,"Nemate dovoljno materijala za to oruzije."); return 1; } }
else if(strcmp(x_weapon,"shotgun",true) == 0) { if(!PlayerToPoint(15.0,playerid,1484.3933,-1731.2124,6.7213)) { SendClientMessage(playerid, COLOR_GREY, "Ovo oruzije mozete da prodate samo na Crnom Trzistu."); return 1; } if(PlayerInfo > 199) { weapon = 25; price = 200; ammo = 50; } else { SendClientMessage(playerid,COLOR_GREY,"Nemate dovoljno materijala za to oruzije."); return 1; } }
else if(strcmp(x_weapon,"ak47",true) == 0) { if(!PlayerToPoint(15.0,playerid,1484.3933,-1731.2124,6.7213)) { SendClientMessage(playerid, COLOR_GREY, "Ovo oruzije mozete da prodate samo na Crnom Trzistu."); return 1; } if(PlayerInfo > 599) { weapon = 30; price = 600; ammo = 250; } else { SendClientMessage(playerid,COLOR_GREY,"Nemate dovoljno materijala za to oruzije."); return 1; } }
else if(strcmp(x_weapon,"m4",true) == 0) { if(!PlayerToPoint(15.0,playerid,1484.3933,-1731.2124,6.7213)) { SendClientMessage(playerid, COLOR_GREY, "Ovo oruzije mozete da prodate samo na Crnom Trzistu."); return 1; } if(PlayerInfo > 599) { weapon = 31; price = 600; ammo = 250; } else { SendClientMessage(playerid,COLOR_GREY,"Nemate dovoljno materijala za to oruzije."); return 1; } }
else if(strcmp(x_weapon,"rifle",true) == 0) { if(!PlayerToPoint(15.0,playerid,1484.3933,-1731.2124,6.7213)) { SendClientMessage(playerid, COLOR_GREY, "Ovo oruzije mozete da prodate samo na Crnom Trzistu."); return 1; } if(PlayerInfo > 599) { weapon = 33; price = 600; ammo = 50; } else { SendClientMessage(playerid,COLOR_GREY,"Nemate dovoljno materijala za to oruzije."); return 1; } }
else
{
SendClientMessage(playerid,COLOR_GREY,"Pogresan naziv oruzija.");
return 1;
}
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
if(PlayerInfo > 0)
{
new skill = 2 * PlayerInfo;
new mats = price / 100;
price -= (mats)*(skill);
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Dali ste igracu %s oruzije %s sa %d municije za %d materijala.", giveplayer,x_weapon, ammo, price);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), "Dobili ste %s sa %d municije od %s.", x_weapon, ammo, sendername);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
new gunname;
GetWeaponName(weapon, gunname, sizeof(gunname));
format(string, sizeof(string), "* %s daje %s igracu %s.", sendername, gunname,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeapon(giveplayerid,weapon,ammo);
PlayerInfo -= price;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Niste blizu igraca.");
return 1;
}
}
else
{
format(string, sizeof(string), "%d nije konektovan.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava