Lotto Script help
#1

Okay i am board and i want to do some thing unique... every one who will read this say lol /lotto is unique?? nope it isn't but this is:

Okay i mapped a place some where in ls.. lotto place and i wanna do that to write /lotto you have to be in these cords.. it's easy to do i am sure but i am not getting i right i think can any one help me please use any FS u want there are loads on sa-mp.com.. Thanks very much if you know how to do it let me know please thanks.

Karl1195
Reply
#2

Код:
#include <a_samp>
#include "../include/gl_common.inc"

new Float:X = 	0.0;  //cange 0.0 to the right x, y and z coords.
new Float:Y =	0.0;
new Float:Z =	0.0;
new Float:R =   0.0;  //the range.

public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[256];
	new idx;
	cmd = strtok(cmdtext, idx);
	if (strcmp("/Lotto", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid,X,Y,Z,R))
	    {
	    ShowPlayerDialog(playerid,23,DIALOG_STYLE_INPUT,"Lotto","Choose your number between 1 and 10. Participating will cost $10!","Choose","Cancel");
	    return 1;
	    }
	    else
	    {
	        SendClientMessage(playerid, 0xFFFFFF, "You are not in the Four Dragons Casino! Use /Casino to go there!");
	        return 1;
		}
    }
	return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 23)
	{
		if(response)
		{
		    GivePlayerMoney(playerid,-10);
		    new Jackpot = random(10);
		    new Tweedeprijs = random(7);
		    new Derdeprijs = random(5);
			if(strlen(inputtext) == Jackpot)
			    {
			        SendClientMessage(playerid, 0xFFFFFF, "You won the Jackpot! Well done!");
			        GivePlayerMoney(playerid, 10000);
			        return 1;
				}

			if(strlen(inputtext) == Tweedeprijs)
			    {
			        SendClientMessage(playerid, 0xFFFFFF, "You won the second price! Well done!");
			        GivePlayerMoney(playerid, 2500);
			        return 1;
				}
			if(strlen(inputtext) == Derdeprijs)
			    {
                    SendClientMessage(playerid, 0xFFFFFF, "You won the third price! Well done!");
                    GivePlayerMoney(playerid, 100);
			        return 1;
				}
				else
			    {
                    SendClientMessage(playerid, 0xFFFFFF, "Too bad, maybe next time better!");
                    return 1;
				}
		}
		return 1;
	}
	return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)