help plz with this cmd +rep - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help plz with this cmd +rep (
/showthread.php?tid=604390)
help plz with this cmd +rep -
LovelySoomro - 04.04.2016
PHP код:
dcmd_lotto(playerid,params[])
{
new ticket, string[128];
if(LottoRunning == 0) return SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {FFFF80}There isn't a lotto running!");
if(sscanf(params,"d",ticket)) return SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {FFFF80}/lotto [1-10]");
{
if(ticket < 1 || ticket > 10) return SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {FFFF80}Lotto ticket must be within 1 and 10.");
if(lottowinner[playerid] == 1) return SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {FFFF80}You already have a lotto ticket!");
if(IsNumTaken(ticket))return SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {FFFF80}This number is already taken by someone!");
format(string,sizeof(string),"[NGP]: {FFFF80}You have bought ticket number %i. Good luck!",ticket);
SendClientMessage(playerid,LIGHTBLUE,string);
lottowinner[playerid] = 1;
ticketnum[playerid]=ticket;
}
return 1;
}
i take number 1 and other take also 1 why client message is not come already taken by some one
Re: help plz with this cmd +rep -
Harty - 04.04.2016
Post IsNumTaken(ticket) stock.
Regards.
Re: help plz with this cmd +rep -
LovelySoomro - 04.04.2016
PHP код:
stock IsNumTaken(n)
{
new m;
foreach(m:Player)
{
if(ticketnum[m]==1)
{
if(ticketnum[m]==n)
}}
return 1;
}
Re: help plz with this cmd +rep -
LovelySoomro - 04.04.2016
help help help plz +rep
Re: help plz with this cmd +rep -
LovelySoomro - 04.04.2016
PHP код:
new m;
foreach(m:Player)
{
if(ticketnum[m]== ticket)return SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {FFFF80}This number is already taken by someone!");
}
problem solved e.e no one help me i will fix it