SA-MP Forums Archive
ZCMD include. - 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: ZCMD include. (/showthread.php?tid=622692)



ZCMD include. - aymane123 - 25.11.2016

guys i am new to those commands includes can anyone give me a standard command with them like /heal ,??
i can do it like this:
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/heal", cmdtext, true, 5) == 0)
	{
		SetPlayerHealth(playerid, 100);
		return 1;
	}
But i want to know how to do it with zcmd or sscanf can anyone post some examples.


Re: ZCMD include. - Vince - 25.11.2016

And the first thing that pops into your mind is "let's make a topic" and not "let's search"?


Re: ZCMD include. - Micko123 - 25.11.2016

WOW

https://sampforum.blast.hk/showthread.php?tid=91354


Re: ZCMD include. - TwinkiDaBoss - 25.11.2016

Sample code
pawn Code:
CMD:healme(playerid,params[]) {
    SetPlayerHealth(playerid, 100);
    return 1;
}


CMD:heal(playerid,params[]) {
    new otherplayer;
    if(sscanf(params,"u",otherplayer)) return SendClientMessage(playerid,COLOR_RED,"Usage: /heal [playerid]");
    if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid,COLOR_RED,"That person is not online");
    SetPlayerHealth(otherplayer, 100);
    SendClientMessage(otherplayer, COLOR_GREEN,"You have been healed! Praise the Lord!")
    return 1;
}



Re: ZCMD include. - aymane123 - 25.11.2016

I Tought that i will get more better explain if i posted a topic,andif u want plzz help me


Re: ZCMD include. - Dayrion - 25.11.2016

Quote:
Originally Posted by aymane123
View Post
I Tought that i will get more better explain if i posted a topic,andif u want plzz help me
Quote:
Originally Posted by TwinkiDaBoss
View Post
Sample code
pawn Code:
CMD:healme(playerid,params[]) {
    SetPlayerHealth(playerid, 100);
    return 1;
}


CMD:heal(playerid,params[]) {
    new otherplayer;
    if(sscanf(params,"u",otherplayer)) return SendClientMessage(playerid,COLOR_RED,"Usage: /heal [playerid]");
    if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid,COLOR_RED,"That person is not online");
    SetPlayerHealth(otherplayer, 100);
    SendClientMessage(otherplayer, COLOR_GREEN,"You have been healed! Praise the Lord!")
    return 1;
}



Re: ZCMD include. - aymane123 - 25.11.2016

Thx To All i Understood.