03.05.2016, 20:13
I think I get it. When a player type /add_police, the player is added to the faction 'Police' ?
Firstly, You need to show your parameters with the enum like :
I will try to explain how does parameters work.
You have enmuerated player info by a var (called pInfo for me). To call those var', you need an another var' which is like that :
For exemple, if I want call the seconde variable (pAdminlvl) I write : PlayerInfo[playerid][pAdminlvl]. You get it ?
Now:
This thing is only when you have already open the file (thanks to : INI:NameOfFile = INI_Open(PathOfTheFile))
To change a variable of a player like an admin level, you need to do like that :
Exemple set admin lvl 5 (owner) :
By the way this is juste an example, you need to change PlayerInfo[playerid][pAdminlvl] by your own variable.
My english is very bad as you can see. If you didn't understand something say it.
If you want some help for your cmd, show us : enumerate parameters and var' which get enumerated para'.
Firstly, You need to show your parameters with the enum like :
PHP код:
enum pInfo
{
pMDP,
pAdminlvl,
pCash,
pScore,
pLog,
...
}
You have enmuerated player info by a var (called pInfo for me). To call those var', you need an another var' which is like that :
PHP код:
new PlayerInfo[MAX_PLAYERS][pInfo]
Now:
PHP код:
dini_IntSet(Gracz,"Police", 1);
To change a variable of a player like an admin level, you need to do like that :
Exemple set admin lvl 5 (owner) :
PHP код:
CMD:admin(playerid, params[])
{
PlayerInfo[playerid][pAdminlvl] = 5; // Changing the variable pAdminlvl to 5. (Changing admin level of the player to 5)
SendClientMessage(playerid, -1, "You are now the owner of the server!");
return 1;
}
My english is very bad as you can see. If you didn't understand something say it.
If you want some help for your cmd, show us : enumerate parameters and var' which get enumerated para'.