How to give levels to everyone?
#1

I am making a command which when you type in you get a dialog to choose, money or level.
When you choose you have to type in how many levels you want to give to everyone.
For example: If I am at level 3, and an admin does that command, chooses level, types in 5, I get 5 more levels,
I don't want him to set my level to five, but to add that to what I already have.

Here's what I'm trying to do:
Код:
		case DIALOG_NAGRADE_LEVEL:
		{
			if(response)
			{
				for(new i; i < GetMaxPlayers(); i++)
				{
					new leveligraca = GetPlayerScore(i);
					SetPlayerScore(leveligraca, ++(inputtext));
				}
			}
		}
I get this error: must be lvalue (non-constant)
How should I do this?
Reply
#2

You need to convert inputtext into an integer.

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

Example:
PHP код:
new string[4] = "250";
new 
iValue strval(string); // iValue is now '250
//In your case:
new ourValue strval(inputtext); 
I assume using the players score as the player ID was a mistake. You just need to add them together.
PHP код:
SetPlayerScore(iGetPlayerScore(i) + ourValue); 
Reply
#3

Thank you man, +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)