Can i make admin commands with this?
#7

I did, i i fixed that i think..., but i may have did it rong,
Код:
	if(strcmp(cmd, "/login", true) == 0)
	{
  if(MiniGame[playerid] == 1) return GameTextForPlayer(playerid,"You cant use this command because you are in a minigame",5000,4);
	new PlayerName[24];
	tmp = strtok(cmdtext, idx);
	if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_SG, "USAGE: /login [password]");
  new name[MAX_PLAYER_NAME];
	if(IsLogged[playerid] == 1)
	{
	SendClientMessage(playerid, COLOR_RED, "You already are logged in!");
	return 1;
	}
	else
	{
	GetPlayerName(playerid, name, sizeof(name));
	format(file,sizeof(file),"%s.ini",name);
	if(fexist(file))
	{
	tmp2 = dini_Get(file, "Password");
	if(udb_hash(tmp) != strval(tmp2))
	{
	SendClientMessage(playerid, COLOR_RED, "Login Failed!");
  GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
	printf("%s has failed to login", name);
	}
	else
	{
	IsLogged[playerid] = 1;
	SetPlayerMoney(playerid, dini_Int(file, "Cash"));
	SetPlayerScore(playerid, dini_Int(file, "Score"));
	SetPlayerSkin(playerid, dini_Int(file, "Skin"));
	PlayerInfo[playerid][Level] = dini_Int(file, "level");
	SendClientMessage(playerid, COLOR_LIME, "[System]: Logged in!");
	}
	}
	}
	return 1;
	}
Reply


Messages In This Thread
Can i make admin commands with this? - by -Rebel Son- - 29.03.2010, 03:23
Re: Can i make admin commands with this? - by -Rebel Son- - 29.03.2010, 20:57
Re: Can i make admin commands with this? - by Jonny_lockhart - 29.03.2010, 21:10
Re: Can i make admin commands with this? - by Nero_3D - 29.03.2010, 21:19
Re: Can i make admin commands with this? - by -Rebel Son- - 29.03.2010, 21:33
Re: Can i make admin commands with this? - by Jay420 - 30.03.2010, 06:09
Re: Can i make admin commands with this? - by -Rebel Son- - 30.03.2010, 16:09

Forum Jump:


Users browsing this thread: 1 Guest(s)