SA-MP Forums Archive
Unlock command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Unlock command (/showthread.php?tid=146377)



Unlock command - Mechscape - 07.05.2010

Код:
			new unlocker;
			unlocker = 0;
			format(string3, sizeof(string3), "users/%s.ini", playername3);
			new File: hFile = fopen(string3, io_write);
			if (hFile)
			{
				new var[64];
				format(var, 64, "Locked=%d\n",unlocker);fwrite(hFile, var);
				fclose(hFile);
			}
Код:
if(strcmp(cmd, "/unlockaccount", true) == 0)
	{
		if (PlayerInfo[playerid][pAdmin] >= 3)
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /unlockaccunt (Playername)");
				return 1;
			}
			if(!exist(string))
			{
				SendClientMessage(playerid, COLOR_GREY, "ERROR: This player account doenst exist in users folder!");
				return 1;
			}
          		TogglePlayerControllable(giveplayerid, 1);
			    SendClientMessage(playerid, COLOR_BLUE, "Account unlocked succesfuly.");
			    GetPlayerName(playerid, sendername, sizeof(sendername));
			    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			    format(string, sizeof(string), "[ADMIN]: %s Has Just Unlocked %s Account!.", sendername, giveplayer);
			    ABroadCast(COLOR_LIGHTRED, string, 1);
		}
		else
		{
			SendClientMessage(playerid, COLOR_GRAD1, "You must be a level 3 admin to do this command.");
		}
		return 1;
	}
There's i known, it much mistakes, that i need peoples help.

Please mix it up code into that second code. I'm thank fully.