Help| Command.
#1

Код:
    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.
Reply
#2

Close a command with "return 1;"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)