SA-MP Forums Archive
Help| 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: Help| Command. (/showthread.php?tid=158637)



Help| Command. - [Sk]Noob - 10.07.2010

Код:
    if(!strcmp(cmd, "/Myadminrecord", true) || !strcmp(cmd, "/mar", true))
    {
		if(IsPlayerConnected(playerid))
		{
		    GetPlayerName(playerid, sendername, sizeof(sendername));
		    format(string,sizeof(string), "SDGC/pLogs/%s.admin.log",sendername);
			new File:hFile = fopen(string, io_read);//
			new str[256],day,month,year;
			getdate(year,month,day);
			format(str,sizeof(str),"|_____ My Admin Record _____| (%d.%d.%d)",day,month,year);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
            while(fread(hFile,string)) SendClientMessage(playerid, COLOR_WHITE, string);
            format(str,sizeof(str)," ___________________________ (%d.%d.%d)",day,month,year);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
            fclose(hFile);
		}
    }
    if(!strcmp(cmd, "/getadminrecord", true) || !strcmp(cmd, "/gar", true))
    {
		if(IsPlayerConnected(playerid))
		{
		    if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				tmp = strtok(cmdtext,idx);
				if(!strlen(tmp))
				{
	  				SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /GetAdminRecord [Player ID]");
			        return 1;
				}
	 			giveplayerid = ReturnUser(tmp);
	 			if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
			 			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					    format(string,sizeof(string), "SDGC/pLogs/%s.admin.log",giveplayer);
						new File:hFile = fopen(string, io_read);
						new str[256];
						format(str,sizeof(str),"|_____ %s Admin Record _____|",giveplayer);
			            SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
			            while(fread(hFile,string)) SendClientMessage(playerid, COLOR_WHITE, string);
			            SendClientMessage(playerid, COLOR_LIGHTBLUE, " ___________________________");
			            fclose(hFile);
	                }
				}
            }
		}
    }
When i write this commands its working but it writes: Server: Invalid Command.


Re: Help| Command. - Hiddos - 10.07.2010

Close a command with "return 1;"