Add Command
#4

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 :
PHP код:
enum pInfo
{
    
pMDP,
    
pAdminlvl,
    
pCash,
    
pScore,
    
pLog,
    ...

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 :
PHP код:
new PlayerInfo[MAX_PLAYERS][pInfo
For exemple, if I want call the seconde variable (pAdminlvl) I write : PlayerInfo[playerid][pAdminlvl]. You get it ?
Now:
PHP код:
dini_IntSet(Gracz,"Police"1); 
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) :
PHP код:
CMD:admin(playeridparams[])
{
    
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;

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'.
Reply


Messages In This Thread
Add Command - by Zevcore - 03.05.2016, 18:31
Re: Add Command - by Micko123 - 03.05.2016, 18:34
Re: Add Command - by Zevcore - 03.05.2016, 18:38
Re: Add Command - by Dayrion - 03.05.2016, 20:13
Re: Add Command - by Darkwood17 - 03.05.2016, 20:44
Re: Add Command - by Luis- - 03.05.2016, 20:51
Re: Add Command - by Darkwood17 - 03.05.2016, 20:58

Forum Jump:


Users browsing this thread: 1 Guest(s)