18.04.2012, 22:02
I need to use PVar because of anti-cheat. But I never used or have worked with pvar before. I need to put the pvar code directly after the weapon has given but I have no idea how to do this or if I did it right. Here is the code:
If a player buys a weapon, then set thier PVars with the correct weapon name to whatever ammo they buy. For example, if they buy 3 clips of the desert eagle, then set the Pvar "DesertEagle" to 21 (7 ammo per clip). how will i do this? if someone tells me i will just do the rest. i think it's really simple but i just don't understand pvar...
pawn Код:
else if(pickupid == tec)
{
weapon[playerid] = 32;
weaponcost[playerid] = 6000;
ammo2[playerid] = 60;
SetPVarInt(playerid,"tec", GetPVarInt(playerid,"tec")+100);
TextDrawShowForPlayer(playerid, background);
#if defined ALT
TextDrawSetString(text2, "Use 'ALT' to buy. Cost $6000.");
#else
TextDrawSetString(text2, "Use 'ALT' to buy. Cost $6000.");
#endif
TextDrawShowForPlayer(playerid, text2);
wpicked[playerid] = 1;
SetTimerEx("HideText", 2000, false, "d", playerid);
}