Convertion - 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: Convertion (
/showthread.php?tid=620230)
Convertion -
bugmenotlol - 27.10.2016
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;
}
Re: Convertion -
RockyGamer - 27.10.2016
I think it should work if you put this on top of OnPlayerCommandText
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[30], params[128];
sscanf(cmdtext, "ss", cmd, params);
if(strcmp(cmd, "/mycommand", true) == 0)
{
sscanf(params, "ddd", variables);
}
return 0;
}
EDIT: I mean on the first two lines
Re: Convertion -
bugmenotlol - 27.10.2016
not working at all
when i type /lotto 12
it says "you have choosen lotto 0 as ur lotto"
Re: Convertion -
bugmenotlol - 27.10.2016
bump anyone ??
Re: Convertion -
bugmenotlol - 27.10.2016
is it possible to convert ?
Re: Convertion -
SickAttack - 27.10.2016
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.
Re: Convertion -
bugmenotlol - 27.10.2016
plz help someone as i am just getting problem with params