SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/08/2012, 07:33 AM   #1
SumX
Huge Clucker
 
Join Date: Dec 2011
Posts: 288
Reputation: 13
Default CONVERT

Hey,what's wrong here? The command is not working,the dialog is showing but when I select,nothing happends.

Code:
#define CONVERTING 1600

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        if(dialogid == CONVERTING)
	{
		if(response)
		{
			if(listitem == 0)
			{
				if ( GetPVarInt( playerid, "Money" ) < 1000000 )
				    return SendClientMessage( playerid, -1, "You need 1000000$ to get 100 Coins!");
				    
				SetPVarInt(playerid, "Coins", GetPVarInt(playerid,"Coins") + 100);
				SetPVarInt(playerid, "Money", GetPVarInt(playerid,"Money") - 1000000);
			}
			if(listitem == 1)
			{
				if ( GetPVarInt( playerid, "Money" ) < 1000000 )
				    return SendClientMessage( playerid, -1, "You need 1000000$ to get 1 Score!");
				    
				SetPVarInt(playerid, "Score", GetPVarInt(playerid,"Score") + 1);
				SetPVarInt(playerid, "Money", GetPVarInt(playerid,"Money") - 1000000);
			}
			if(listitem == 2)
			{
				if ( GetPVarInt( playerid, "Coins" ) < 100 )
				    return SendClientMessage( playerid, -1, "You need 100 Coins to get 1000000$!");
				    
				SetPVarInt(playerid, "Money", GetPVarInt(playerid,"Money") + 1000000);
				SetPVarInt(playerid, "Coins", GetPVarInt(playerid,"Coins") - 100);
			}
			if(listitem == 3)
			{
				if ( GetPVarInt( playerid, "Coins" ) < 100 )
				    return SendClientMessage( playerid, -1, "You need 100 Coins to get 1 Score!");

				SetPVarInt(playerid, "Score", GetPVarInt(playerid,"Score") + 1);
				SetPVarInt(playerid, "Coins", GetPVarInt(playerid,"Coins") - 100);
			}
			if(listitem == 4)
			{
				if ( GetPVarInt( playerid, "Score" ) < 2 )
				    return SendClientMessage( playerid, -1, "You need minimum 2 Score to get 1000000$!");

				SetPVarInt(playerid, "Money", GetPVarInt(playerid,"Money") + 1000000);
				SetPVarInt(playerid, "Score", GetPVarInt(playerid,"Score") - 1);
			}
			if(listitem == 5)
			{
				if ( GetPVarInt( playerid, "Score" ) < 2 )
				    return SendClientMessage( playerid, -1, "You need minimum 2 Score to get 100 Coins!");

				SetPVarInt(playerid, "Coins", GetPVarInt(playerid,"Coins") + 100);
				SetPVarInt(playerid, "Score", GetPVarInt(playerid,"Score") - 1);
			}
		}
		else
		{
		SCM(playerid,COLOR_DGREY,"You closed.");
		}
	}
	return 1;
}

CMD:convert( playerid, params[ ] )
{
 	ShowPlayerDialog(playerid, CONVERTING, DIALOG_STYLE_LIST, "Converting Money,Coins,Score.",""COLOR_LIGHTBLUE"1000000$ {FFFFFF}-> {5D66CC}100 Coins\n"COLOR_LIGHTBLUE"1000000$ {FFFFFF}-> {5D66CC}1 Score\n"COLOR_LIGHTBLUE"100 Coins {FFFFFF}-> {5D66CC}1000000$\n"COLOR_LIGHTBLUE"100 Coins {FFFFFF}-> {5D66CC}1 Score\n"COLOR_LIGHTBLUE"1 Score {FFFFFF}-> {5D66CC}1000000$\n"COLOR_LIGHTBLUE"1 Score {FFFFFF}-> {5D66CC}100 Coins","Convert","Cancel");
}
SumX is offline   Reply With Quote
Old 02/08/2012, 08:47 AM   #2
[MM]RoXoR[FS]
Gangsta
 
[MM]RoXoR[FS]'s Avatar
 
Join Date: Mar 2012
Location: Gurgaon,India
Posts: 745
Reputation: 137
Default Re: CONVERT

pawn Code:
CMD:convert( playerid, params[ ] )
{
    ShowPlayerDialog(playerid, CONVERTING, DIALOG_STYLE_LIST, "Converting Money,Coins,Score.",""COLOR_LIGHTBLUE"1000000$ {FFFFFF}-> {5D66CC}100 Coins\n"COLOR_LIGHTBLUE"1000000$ {FFFFFF}-> {5D66CC}1 Score\n"COLOR_LIGHTBLUE"100 Coins {FFFFFF}-> {5D66CC}1000000$\n"COLOR_LIGHTBLUE"100 Coins {FFFFFF}-> {5D66CC}1 Score\n"COLOR_LIGHTBLUE"1 Score {FFFFFF}-> {5D66CC}1000000$\n"COLOR_LIGHTBLUE"1 Score {FFFFFF}-> {5D66CC}100 Coins","Convert","Cancel");
    return 1;
}
__________________
My Works
Top Players Include[Sorts Player's Kills|Money|Deaths|ANYTHING YOU WANT|
pawn Code:
public OnPlayerConnect(playerid)
{
  Ban(playerid);
  return 1;
}

Scripting for Money
[MM]RoXoR[FS] is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me convert MS:RP Mason Scripting Help 5 20/11/2011 06:59 AM
Help to convert [HHT]DRON Scripting Help 10 14/11/2011 08:29 PM
How to convert this to FS $$Money$$ Scripting Help 1 06/11/2011 09:04 AM


All times are GMT. The time now is 04:51 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.