Convert command to zcmd
#1

Код:
	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;
	}
Reply
#2

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

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...
Reply
#4

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
Reply
#5

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?
Reply
#6

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;
    }
Reply
#7

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

That is because it is easy for them.
Reply
#9

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

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..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)