OnDialogResponse
#1

What is wrong with this code?
Код HTML:
	else if( dialogid == DIALOG_DAJSVIMA_NOVAC )
	{
	    if( !response ) return true;
	    if( response )
	    {
	        if((inputtext < 1) || (inputtext > 500000)) return SendClientMessage(playerid,0xFFFFFFFF,"Cifra ne sme biti manja od 5000$, ili vec od 500000$!");
			{
			    kolicina = inputtext;
			    foreach( Player, i )
				{
	        		if( i != INVALID_PLAYER_ID && PlayerLogged[ i ] != false )
					{
	            		DajIgracuNovac( i, kolicina );
	    				format( globalstring, sizeof( globalstring ), ""col_athlone"|:.Black Storm:.| "col_white" Vlasnik %s je nagradio sve igrace sa:  %d$.", ImeIgraca( playerid ), kolicina );
	    				SCMA( -1, globalstring );
					}
				}
			}
		}
	}
ERROR:
Код HTML:
error 033: array must be indexed (variable "inputtext")
error 017: undefined symbol "kolicina"
warning 215: expression has no effect
error 017: undefined symbol "kolicina"
error 017: undefined symbol "kolicina"

Its DSI Give money to all...
Reply
#2

inputtext is a string. You need to turn it into an integer.

https://sampwiki.blast.hk/wiki/Strval

Example:
PHP код:
new string[4] = "250";
new 
iValue strval(string); // iValue is now '250' 
Reply
#3

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
inputtext is a string. You need to turn it into an integer.

https://sampwiki.blast.hk/wiki/Strval

Example:
PHP код:
new string[4] = "250";
new 
iValue strval(string); // iValue is now '250' 
Can you give me code for this up? xd
Reply
#4

PHP код:
if(response)
{
     new 
amount;
     
amount strval(inputtext);
     if(
amount || amount 2)
     {
          return;
     }

Basically.
Reply
#5

Thanks, i'll compile mod to test


EDIT:
btw you learned me how to use strval, master
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)