Convertion
#1

pzl help me to convert this command to deafult command ifstrmp

Код:
CMD:ticket(playerid,params[])
{
new ru[200],ti;
if(IsLottoStarted==false)return SendClientMessage(playerid, 0xFF4500AA, "Lottery has not been started yet.");
if(sscanf(params,"i",ti))return SendClientMessage(playerid,-1,"{ff0000}Wrong Usage of command | Correct Usage : /ticket [your number]");
format(ru,sizeof(ru),"The nuber should be in range of 0-%i",numrange);
if(ti > numrange || ti < 0)return SendClientMessage(playerid,0xFF4500AA,ru);
format(ru,sizeof(ru),"You need to have %i $ to buy ticket.",ticketprice);
if(GetPlayerMoney(playerid)<ticketprice)return SendClientMessage(playerid,0xFF4500AA,ru);
if(takenticket[playerid]==1)return SendClientMessage(playerid,0xFF4500AA,"You have already taken a lottrey ticket.");
if(IsNumTaken(ti))return SendClientMessage(playerid,0xFF4500AA,"The number has already been chosen by other user. | Please chose other number");
takenticket[playerid]=1;
GivePlayerMoney(playerid,-ticketprice);
ticketnum[playerid]=ti;
format(ru,sizeof(ru),"You have chosen %i as your lucky number!!",ti);
SendClientMessage(playerid,0xCCFF00,ru);
return 1;
}
Reply
#2

I think it should work if you put this on top of OnPlayerCommandText

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
cmd[30], params[128];
    
sscanf(cmdtext"ss"cmdparams);
    
    if(
strcmp(cmd"/mycommand"true) == 0)
    {
        
sscanf(params"ddd"variables);
    }
    
    return 
0;

EDIT: I mean on the first two lines
Reply
#3

not working at all

when i type /lotto 12
it says "you have choosen lotto 0 as ur lotto"
Reply
#4

bump anyone ??
Reply
#5

is it possible to convert ?
Reply
#6

I remind you that this board isn't for requests. Have a look at an existing strcmp-based command, and try to convert it. If something is wrong, consider posting the code here.
Reply
#7

plz help someone as i am just getting problem with params
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)