SA-MP Forums Archive
can i make different cmd ? (again) - 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: can i make different cmd ? (again) (/showthread.php?tid=436196)



can i make different cmd ? (again) - edwardluciano - 10.05.2013

can i make different cmd Ex: /sethp is !sethp

old post is wrong section delete by MOD

i not answer thank you last post and do follow him yet

plz answer me again if you online now


sorry my English skill not good


Re: can i make different cmd ? (again) - RajatPawar - 10.05.2013

Use the search feature correctly. AGAIN.


Re: can i make different cmd ? (again) - edwardluciano - 10.05.2013

and one post him can input Onplayertext i need to try it i for got it


Re: can i make different cmd ? (again) - [DOG]irinel1996 - 10.05.2013

I didn't understand anything, but...
pawn Код:
public OnPlayerText(playerid, text[])
{
    if (!strcmp(text, "!hello", true)) {
        SendClientMessage(playerid, -1, "Hello");
        return 0;
     }
    return 1;
}
Are you talking about that?


Re: can i make different cmd ? (again) - edwardluciano - 10.05.2013

Quote:
Originally Posted by [DOG]irinel1996
Посмотреть сообщение
I didn't understand anything, but...
pawn Код:
public OnPlayerText(playerid, text[])
{
    if (!strcmp(text, "!hello", true)) {
        SendClientMessage(playerid, -1, "Hello");
        return 0;
     }
    return 1;
}
Are you talking about that?
yes same this i will try it thankyou


Re: can i make different cmd ? (again) - edwardluciano - 10.05.2013

i try , it show message and script , can hide (!hello)

Hello
!hello


Re: can i make different cmd ? (again) - [DOG]irinel1996 - 10.05.2013

Did you add the return 0 before the } in the strcmp condition?
pawn Код:
public OnPlayerText(playerid, text[])
{
    if (!strcmp(text, "!hello", true)) {
        SendClientMessage(playerid, -1, "Hello");
        return 0; //This one.
     }
    return 1;
}



Re: can i make different cmd ? (again) - edwardluciano - 10.05.2013

Quote:
Originally Posted by [DOG]irinel1996
Посмотреть сообщение
Did you add the return 0 before the } in the strcmp condition?
oh my script is 1 for got change it ok thankyou very much


Re: can i make different cmd ? (again) - edwardluciano - 10.05.2013

you can tell me something ?


Код:
if (!strcmp(text, "!level", true))
		{
	        if (PlayerInfo[playerid][pAdmin] >= 21 && PlayerInfo[playerid][pAdmin] <= 45)
			{
			    tmp = strtok(text, idx);
				if(!strlen(tmp))
				{
	    			SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Usage: /level 1(Mode)/2(Admins)");
					SendClientMessage(playerid, COLOR_YELLOW2, "Function: Will see commands of specified level");
					return 0;
	 			}
	 			new selected = strval(tmp);
				if (selected == 1)
				{
					if (PlayerInfo[playerid][pAdmin] >= 21)
					{
		    			SendClientMessage(playerid, COLOR_LIGHT_BLUE, "___________ |- Moderator -| ___________");
						SendClientMessage(playerid, COLOR_YELLOW2, "kick warn unwarn ban");
					}
					else
					{
		    			return 0;
					}

				}
				if (selected == 2)
				{
				    if (PlayerInfo[playerid][pAdmin] == 45)
					{
		    			SendClientMessage(playerid, COLOR_LIGHT_BLUE, "___________ |- Administrator -| ___________");
		    			SendClientMessage(playerid, COLOR_YELLOW2,"All Mode Commands");
		    			SendClientMessage(playerid, COLOR_YELLOW2,"(veh)icle paycheck makeleader");
						
					}
					else
					{
	    				return 0;
					}
				}
			}
			else
			{
			    return 1;
			}
	        return 0;
     	}
when type !level 1 it not show command list it chat !level 1 normally

you can fix this thankyou for that


Re: can i make different cmd ? (again) - Da_Noob - 10.05.2013

Quote:
Originally Posted by edwardluciano
Посмотреть сообщение
you can tell me something ?


Код:
if (!strcmp(text, "!level", true))
		{
	        if (PlayerInfo[playerid][pAdmin] >= 21 && PlayerInfo[playerid][pAdmin] <= 45)
			{
			    tmp = strtok(text, idx);
				if(!strlen(tmp))
				{
	    			SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Usage: /level 1(Mode)/2(Admins)");
					SendClientMessage(playerid, COLOR_YELLOW2, "Function: Will see commands of specified level");
					return 0;
	 			}
	 			new selected = strval(tmp);
				if (selected == 1)
				{
					if (PlayerInfo[playerid][pAdmin] >= 21)
					{
		    			SendClientMessage(playerid, COLOR_LIGHT_BLUE, "___________ |- Moderator -| ___________");
						SendClientMessage(playerid, COLOR_YELLOW2, "kick warn unwarn ban");
					}
					else
					{
		    			return 0;
					}

				}
				if (selected == 2)
				{
				    if (PlayerInfo[playerid][pAdmin] == 45)
					{
		    			SendClientMessage(playerid, COLOR_LIGHT_BLUE, "___________ |- Administrator -| ___________");
		    			SendClientMessage(playerid, COLOR_YELLOW2,"All Mode Commands");
		    			SendClientMessage(playerid, COLOR_YELLOW2,"(veh)icle paycheck makeleader");
						
					}
					else
					{
	    				return 0;
					}
				}
			}
			else
			{
			    return 1;
			}
	        return 0;
     	}
when type !level 1 it not show command list it chat !level 1 normally

you can fix this thankyou for that
Did you put this under OnPlayerText or under OnPlayerCommandText? It should go under OnPlayerText.