SA-MP Forums Archive
Convert command to zcmd - 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: Convert command to zcmd (/showthread.php?tid=376531)



Convert command to zcmd - cotyzor - 10.09.2012

Код:
	if(strcmp(cmd, "/mission", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerToPoint(5.0, playerid, 324.6008,1129.5367,1083.8828))
			{
				GetPlayerName(playerid, sendername, sizeof(sendername));
				ShowPlayerDialog(playerid,8100,DIALOG_STYLE_LIST,"Misiuni","Delete :)","Select", "Close"");			
				format(string, sizeof(string), "** %s is doing some missions! **", sendername);
				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);			
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GRAD1,"You aren't near NPC!");
			    return 1;
			}
		}
		return 1;
	}



Re: Convert command to zcmd - mamorunl - 10.09.2012

CMD:mission(playerid, params[]) instead of if(strcmp(cmd, /mission, true) == 0) and it should be outside of OnPlayerCommandText. That is all.


Re: Convert command to zcmd - Roach_ - 10.09.2012

This is your command:
pawn Код:
CMD:mission(playerid)
{
    if(!PlayerToPoint(5.0, playerid, 324.6008,1129.5367,1083.8828)) return SendClientMessage(playerid, COLOR_GRAD1,"You aren't near NPC!");

    GetPlayerName(playerid, sendername, sizeof(sendername));
    ShowPlayerDialog(playerid,8100,DIALOG_STYLE_LIST,"Misiuni","Delete :)","Select", "Close");         
    format(string, sizeof(string), "** %s is doing some missions! **", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);        
   
    return 1;
}
PS: The command must be outside the OnPlayerCommandText Callback and any other Callback...


Re: Convert command to zcmd - CrazyChoco - 10.09.2012

pawn Код:
CMD:mission(playerid, params[])
{
if(IsPlayerConnected(playerid))
        {
            if(PlayerToPoint(5.0, playerid, 324.6008,1129.5367,1083.8828))
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                ShowPlayerDialog(playerid,8100,DIALOG_STYLE_LIST,"Misiuni","Delete :)","Select", "Close"");        
                format(string, sizeof(string), "
** %s is doing some missions! **", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);        
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1,"
You aren't near NPC!");
                return 1;
            }
        }
        return 1;
    }
as he said :3 just place it anywhere in script, like in bottom of it


Re: Convert command to zcmd - [HK]Ryder[AN] - 10.09.2012

Here you go
pawn Код:
CMD:mission(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerToPoint(5.0, playerid, 324.6008,1129.5367,1083.8828))
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                ShowPlayerDialog(playerid,8100,DIALOG_STYLE_LIST,"Misiuni","Delete :)","Select", "Close"");        
                format(string, sizeof(string), "
** %s is doing some missions! **", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);        
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1,"
You aren't near NPC!");
                return 1;
            }
        }
        return 1;
    }
gimme a rep?


Re: Convert command to zcmd - yLuSsSIoN - 10.09.2012

Enjoy
pawn Код:
CMD:mission(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerToPoint(5.0, playerid, 324.6008,1129.5367,1083.8828))
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                ShowPlayerDialog(playerid,8100,DIALOG_STYLE_LIST,"Misiuni","Delete :)","Select", "Close"");        
                format(string, sizeof(string), "
** %s is doing some missions! **", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);        
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1,"
You aren't near NPC!");
                return 1;
            }
        }
        return 1;
    }



Re: Convert command to zcmd - CrazyChoco - 10.09.2012

Woow, Why is everyone posting the same command, again and again?


Re: Convert command to zcmd - Glint - 10.09.2012

That is because it is easy for them.


Re: Convert command to zcmd - Kirollos - 10.09.2012

why you write if(IsPlayerConnected(playerid)) ? it's kinda useless.


Re: Convert command to zcmd - Roach_ - 10.09.2012

Quote:
Originally Posted by kirollos
Посмотреть сообщение
why you write if(IsPlayerConnected(playerid)) ? it's kinda useless.
They only copied the command an changed the first line..
Look at my command..

PS: It's only an example..