help plz with this cmd +rep
#1

PHP код:
dcmd_lotto(playerid,params[])
{
    new 
ticketstring[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 || 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
Reply
#2

Post IsNumTaken(ticket) stock.

Regards.
Reply
#3

PHP код:
stock IsNumTaken(n)
{
    new 
m;
    foreach(
m:Player)
    {
    if(
ticketnum[m]==1)
    {
    if(
ticketnum[m]==n)
    }}
    return 
1;

Reply
#4

help help help plz +rep
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)