Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: sseebbyy on November 03, 2011, 07:03:52 pm
-
I tryied to make "makeadmin" command, but not work.. not change to "1" in .ini file...
AnyBody help me please...
[pawn]else if (strcmp(cmd, "giveadmin", true) == 0) {
if(IsLogged[playerid] == 0) SendClientMessage(playerid,NOTACCES,"Need to login first !");
else if(Spawned[playerid] == 0) SendClientMessage(playerid,NOTACCES,"You not are Spawned !");
else if(IsPlayerAdmin(playerid))
{
new plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c giveadmin [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Users/%s.ini",name);
if(!fexist(file))
{
dini_Set(file,"AdminLevel","1");
PlayerInfo[plr][AdminLevel] = 1;
}
}
}else{
SendClientMessage(playerid,NOTACCES,"***Not have permission to use this command!");
}
return 1;
}[/pawn]
-
[pawn]if(!fexist(file))[/pawn]
This line isn't needed.
-
Work !
Thank you very much Stormeus !
-
New Problem ...
[pawn]SetPlayerMoney(playerid,dini_Get(file,"Cash"));[/pawn]
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\RO.pwn(434) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.0.3367 Copyright (c) 1997-2005, ITB CompuPhase
1 Error.
How can i fix this ? :-\
-
Use dini_IntGet. It's expecting a number, not a string.