SA-MP Forums Archive
Help me please - 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 me please (/showthread.php?tid=647022)



Help me please - Osamakurdi - 28.12.2017

I have This Code




Код:
CMD:dice(playerid)
{
	if(GetPlayerMoney(playerid) < 1000000)
	{
	SendClientMessage(playerid , 0x0000FFFF, "You Dont Have Enough Money.");
	}
      //How i can make code stop excuting if player dont have 1000000 ??

        new Dice;
	Dice = random(7);
	new lose;
	lose = random(6);
	
	
    if(Dice == 1)
    {
        SendClientMessage(playerid, -1, "The dice number 1");
    }
    if(Dice == 2)
    {
        SendClientMessage(playerid, -1, "The dice number 2");
        GivePlayerMoney(playerid,50000);
    }
    if(Dice == 3)
    {
        SendClientMessage(playerid, -1, "The dice number 3");
        GivePlayerMoney(playerid,50000);
    }
    if(Dice == 4)
    {
    	GivePlayerMoney(playerid,50000);
        SendClientMessage(playerid, -1, "The dice number 4");
    }
    if(Dice == 5)
    {
        GivePlayerMoney(playerid,50000);
        SendClientMessage(playerid, -1, "The dice number 5");
    }
    if(Dice == 6)
    {
        GivePlayerMoney(playerid,50000);
        SendClientMessage(playerid, -1, "The dice number 6 and you wins 1000000 money!");
        GivePlayerMoney(playerid, 1000000);
    }
    if(lose == 1)
    {
    SendClientMessage(playerid, -1, "But Your Money Have Been reseted.");
	ResetPlayerMoney(playerid);
    }
    if(lose == 5)
    {
    SendClientMessage(playerid, -1, "But Your Money Have Been reseted.");
    ResetPlayerMoney(playerid);
    }
	
    return 1;
}



I Dont Have Any Errors But how i can make if getplayermoney < 1000000 stop excuting until he get this amount
please help.!


Re: Help me please - Primes007 - 28.12.2017

PHP код:
CMD:dice(playerid)
{
    if(
GetPlayerMoney(playerid) < 1000000) return SendClientMessage(playerid 0x0000FFFF"You Dont Have Enough Money.");
        new 
Dice;
    
Dice random(7);
    new 
lose;
    
lose random(6);
    
    
    if(
Dice == 1)
    {
        
SendClientMessage(playerid, -1"The dice number 1");
    }
    if(
Dice == 2)
    {
        
SendClientMessage(playerid, -1"The dice number 2");
        
GivePlayerMoney(playerid,50000);
    }
    if(
Dice == 3)
    {
        
SendClientMessage(playerid, -1"The dice number 3");
        
GivePlayerMoney(playerid,50000);
    }
    if(
Dice == 4)
    {
        
GivePlayerMoney(playerid,50000);
        
SendClientMessage(playerid, -1"The dice number 4");
    }
    if(
Dice == 5)
    {
        
GivePlayerMoney(playerid,50000);
        
SendClientMessage(playerid, -1"The dice number 5");
    }
    if(
Dice == 6)
    {
        
GivePlayerMoney(playerid,50000);
        
SendClientMessage(playerid, -1"The dice number 6 and you wins 1000000 money!");
        
GivePlayerMoney(playerid1000000);
    }
    if(
lose == 1)
    {
    
SendClientMessage(playerid, -1"But Your Money Have Been reseted.");
    
ResetPlayerMoney(playerid);
    }
    if(
lose == 5)
    {
    
SendClientMessage(playerid, -1"But Your Money Have Been reseted.");
    
ResetPlayerMoney(playerid);
    }
    
    return 
1;




Re: Help me please - Osamakurdi - 28.12.2017

Thanks !!