21.03.2017, 03:39
I'm not sure how else to word it, so I'll just show what I'm trying to do with an example.
Basically in that example, what I'm trying to do is have is the stat string acted like I typed in the variable there.
I'm not sure if I'm just overthinking this or not, but is there a solution to this?
pawn Код:
//Let's say I had a var called PlayerInfo[playerid][pAdmin] and it equals 2.
function(blah[]) //blah in this case would be "pAdmin"
{
new string[128],stat[32];
format(stat,sizeof(stat),"PlayerInfo[playerid][%s]",blah); //at this point the string should read as "PlayerInfo[playerid][pAdmin]"
format(string,sizeof(string),"The value of this stat is %i.",stat); //here's where the issue is since stat is a string and not an integer
SendClientMessage(playerid,-1,string);
}
pawn Код:
format(string,sizeof(string),"The value of this stat is %i.",PlayerInfo[playerid][pAdmin]);