28.12.2013, 05:41
Just saying
I'm a newbie, Trying to script slowly. So, Please don't complain me if this code is wrong..
Hope you understand,
Thanks.
Код:
new helper[MAX_PLAYERS]; CMD:sethelper(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return 0; new giveplayerid; if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, red, "Usage: /sethelper [ID]"); helper[giveplayerid] = 1; new string[128]; new pName[24], aName[24]; GetPlayerName(playerid, aName, 24); GetPlayerName(giveplayerid, pName, 24); format(string, sizeof(string), "You have made %s a helper", pName); SendClientMessage(playerid, blue, string); format(string, sizeof(string), "SERVER: Administrator %s has made you a helper", aName); SendClientMessage(giveplayerid, blue, string); return 1; } pInfo[id] = helper; format(file, 100, ACCOUNTS_PATH, GetName(id)); new INI:ACCOUNT = INI_Open(file); INI_WriteInt(ACCOUNT, "Helper", pInfo[id]); INI_Close(ACCOUNT); return 1;
Hope you understand,
Thanks.