08.09.2011, 19:06
I need help again 
I made a /setvip command but the problem is that the command isnt making the selected player a vip it makes me ...
Heres the code
I need help with this part of the code:
I dont know how to make the command to edit the selected player's .ini file
Sorry for english

I made a /setvip command but the problem is that the command isnt making the selected player a vip it makes me ...
Heres the code
pawn Код:
if(strcmp(cmd, "/setvip", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(IsPlayerAdmin(playerid))
{
new INI:File = INI_Open(UserPath(playerid));
new targetid = strval(tmp);
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Invalid ID!");
if(!strlen(tmp)) return SendClientMessage(playerid, TEAMCOLOR_PSYCHO, "Usage: /setvip [playerid]");
INI_SetTag(File,"data");
INI_WriteInt(File,"VIP",1);
INI_Close(File);
PlayerInfo[targetid][pVIP] = 1;
return 1;
}
}
Код:
INI_SetTag(File,"data"); INI_WriteInt(File,"VIP",1); INI_Close(File);
Sorry for english