SA-MP Forums Archive
duel 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)
+--- Thread: duel command (/showthread.php?tid=500037)



duel command - AhmedMohamed - 11.03.2014

hello all, what is wrong in it??
Код:
CMD:duel(playerid,params[])
{
	if(PlayerInfo[playerid][Level] >= 3)
    {
	 if(PlayerInfo[playerid][OnDuty])
	 {
	  new id, id2;
	  if (sscanf(params, "uii", id, id2)) SendClientMessage(playerid, red, "Usage:{FFFFFF} /duel [playerid 1] [playerid 2]");
      SetPlayerPos(id,1816.9847, -477.8942, 773.7011);
	  SetPlayerInterior(id,1);
	  SetPlayerPos(id2,1816.9847, -477.8942, 773.7011);
	  SetPlayerInterior(id2,1);
	}else return SendClientMessage(playerid, red,"ERROR: You Must Be On-duty To Use That Command. Use /aduty");
	}else return SendClientMessage(playerid, red, "ERROR: You need to be admin to use that command");
	return 1;
}
No errors while compile but when I type it in game it give me this message : Usage: /duel [playerid 1] [playerid 2]

Thank you


Re: duel command - AhmedMohamed - 11.03.2014

if no one know so please give me /duel [player 1] [player 2] command for admins and thank you


Re: duel command - rangerxxll - 11.03.2014

pawn Код:
CMD:duel(playerid,params[])
{
    if(PlayerInfo[playerid][Level] >= 3)
    {
     if(PlayerInfo[playerid][OnDuty])
     {
      new id, id2;
      if (sscanf(params, "uu", id, id2)) SendClientMessage(playerid, red, "Usage:{FFFFFF} /duel [playerid 1] [playerid 2]");
      SetPlayerPos(id,1816.9847, -477.8942, 773.7011);
      SetPlayerInterior(id,1);
      SetPlayerPos(id2,1816.9847, -477.8942, 773.7011);
      SetPlayerInterior(id2,1);
    }else return SendClientMessage(playerid, red,"ERROR: You Must Be On-duty To Use That Command. Use /aduty");
    }else return SendClientMessage(playerid, red, "ERROR: You need to be admin to use that command");
    return 1;
}
Should work. You were using "uii", which is saying one param is a playerid and the other two are a integer. Refer to ******'s sscanf chart.
https://sampforum.blast.hk/showthread.php?tid=120356


Re: duel command - Jefff - 11.03.2014

pawn Код:
CMD:duel(playerid,params[])
{
    new id1, id2;
    if(PlayerInfo[playerid][Level] < 3) SendClientMessage(playerid, red, "ERROR: You need to be admin to use that command");
    else if(!PlayerInfo[playerid][OnDuty]) SendClientMessage(playerid, red,"ERROR: You Must Be On-duty To Use That Command. Use /aduty");
    else if(sscanf(params, "uu", id1, id2)) SendClientMessage(playerid, red, "Usage:{FFFFFF} /duel [playerid 1] [playerid 2]");
    else if(id1 == INVALID_PLAYER_ID) SendClientMessage(playerid, red,"ERROR: First ID is not connected");
    else if(id2 == INVALID_PLAYER_ID) SendClientMessage(playerid, red,"ERROR: Second ID is not connected");
    else{
        SetPlayerInterior(id1,1);
        SetPlayerInterior(id2,1);
        SetPlayerPos(id1,1816.9847, -477.8942, 773.7011);
        SetPlayerPos(id2,1816.9847, -477.8942, 773.7011);
    }
    return 1;
}



Re: duel command - AhmedMohamed - 11.03.2014

not working for both but REP+ for rangerxxll to telling me about the letters "ui, uu"
thanks too Jefff for trying to help me

I still need help


Re: duel command - Jefff - 11.03.2014

Whats wrong in my code?


Re: duel command - AhmedMohamed - 11.03.2014

it give me that message in any case : Usage: /duel [playerid 1] [playerid 2]