Help to give players materials.
#1

I'm reworking /viplocker....
How can I give the player materials?
I'm using this, but it gives me an error in compiler and I can't compile.
Код:
	    {
	        case 0:
	        {

    			if(PlayerInfo[playerid][pDonateRank] < 1)
			    {
			        if(PlayerInfo[playerid][pTokens] < 1)
			        {
			            SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for the materials.");
			            return 1;
			        }
					PlayerInfo[playerid][pTokens] -= 1;
					format(string, sizeof(string), "VIP: You have traded 1 token for 1000 materials, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
			        SendClientMessageEx(playerid, COLOR_YELLOW, string);
				}
				PlayerInfo[playerid][pMats] = currentmats +1000;
	        }
	    }
	}
Reply
#2

Can't guess like this u didn't even say what the error was
But by the exact script u have unmatched brackets closing
Reply
#3

And the error is in the line..
Otherwise i supose that you are using wrongly SendClientMessageEx you should do it like this

SendClientMessage(playerid, COLOR_YELLOW, string);
Also as they said upper you havent closed your brackets correctly.
Reply
#4

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
Can't guess like this u didn't even say what the error was
But by the exact script u have unmatched brackets closing
Quote:
Originally Posted by JustBored
Посмотреть сообщение
And the error is in the line..
Otherwise i supose that you are using wrongly SendClientMessageEx you should do it like this

SendClientMessage(playerid, COLOR_YELLOW, string);
Also as they said upper you havent closed your brackets correctly.
The error was this...
C:\Users\Administrator\Desktop\PLA\gamemodes\pla.p wn(85341) : error 017: undefined symbol "currentmats"
Reply
#5

A variable is missing and by the looks of it, it needs to be global
Reply
#6

Fixed it, needed to define it first by adding this;
new currentmats = PlayerInfo[playerid][pMats];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)