I need help... with Commands
#1

How do i Change one of these Commands

Код:
   if(strcmp(cmd, "/finishreport", true) == 0 || strcmp(cmd, "/frp", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pAdmin] >= 2)
	        {
	            tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
			    	SendClientMessage(playerid, COLOR_WHITE, "USAGE: /(f)inish®e(p)ort[PlayerID/PartOfName]");
			    	return 1;
				}
				giveplayerid = ReturnUser(tmp);
				if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
				    	if(AcceptedReport[playerid] != giveplayerid)
				        {
				            return SendClientMessage(playerid, -1," You haven't accepted this player's report !");
						}
      	 				GetPlayerName(playerid, sendername, sizeof(sendername));
						GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						format(string, sizeof(string), "AdmCmd: %s has Finished %s's report", sendername, giveplayer);
						ABroadCast(COLOR_RED, string, 1);
						format(string, sizeof(string), "%s has Finished your report, you can now continue your gameplay.", sendername);
						SendClientMessage(giveplayerid, COLOR_WHITE, string);
						AcceptedReport[playerid] = -1;
						Talkingto[playerid] = -1;
       				}
				}
	        }
	        else
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You are not authorized to use that command !");
	            return 1;
	        }
	    }
	    return 1;
	}
Into like a CMDCommand) type of Command?
Reply
#2

pawn Код:
CMD:command(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        if(isnull(params))
        {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /(f)inish®e(p)ort[PlayerID/PartOfName]");
            return 1;
        }
        giveplayerid = ReturnUser(params);
        if(IsPlayerConnected(giveplayerid))
        {
            if(giveplayerid != INVALID_PLAYER_ID)
            {
                if(AcceptedReport[playerid] != giveplayerid)
                {
                    return SendClientMessage(playerid, -1," You haven't accepted this player's report !");
                }
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                format(string, sizeof(string), "AdmCmd: %s has Finished %s's report", sendername, giveplayer);
                ABroadCast(COLOR_RED, string, 1);
                format(string, sizeof(string), "%s has Finished your report, you can now continue your gameplay.", sendername);
                SendClientMessage(giveplayerid, COLOR_WHITE, string);
                AcceptedReport[playerid] = -1;
                Talkingto[playerid] = -1;
            }
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "   You are not authorized to use that command !");
        return 1;
    }
    return 1;
}
There is a lot of different tutorials on this subject. Search before posting.
Reply
#3

Oh.. Thank you! And Sorry
Reply
#4

You have to install ZCMD. If you change one command to ZCMD, you have to do it to all, or else it will bug. Also, install sscanf2, and read up on some tutorials
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)