Help to give players materials. - 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 to give players materials. (
/showthread.php?tid=443810)
Help to give players materials. -
Grooty - 13.06.2013
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;
}
}
}
Re: Help to give players materials. -
park4bmx - 13.06.2013
Can't guess like this u didn't even say what the error was
But by the exact script u have unmatched brackets closing
Respuesta: Help to give players materials. -
JustBored - 13.06.2013
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.
Re: Respuesta: Help to give players materials. -
Grooty - 13.06.2013
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"
Re: Help to give players materials. -
park4bmx - 13.06.2013
A variable is missing and by the looks of it, it needs to be global
Re: Help to give players materials. -
Grooty - 13.06.2013
Fixed it, needed to define it first by adding this;
new currentmats = PlayerInfo[playerid][pMats];