/enter help
#1

Can someone helpme with this?

pawn Код:
{
    if (strcmp("/enter", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -2718.7581,-318.1504,7.8438))
        SetPlayerPos(playerid,-27.2596,-158.7045,1011.7094);//college
     
        return 1;
    }
else    if (strcmp("/enter", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, -2665.6848,-7.8725,6.1328 ))
        SetPlayerPos(playerid,53.3778,-188.6606,998.3098);
        return 1;
    }
else    if (strcmp("/enter", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,-2717.7808,52.1632,4.3359))
        SetPlayerPos(playerid,772.111999,-3.898649,1000.728820);
        SetPlayerInterior(playerid, 5);//gym
        return 1;
 }

else    if (strcmp("/exit", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -27.2596,-158.7045,1011.7094 ))
        SetPlayerPos(playerid,-2718.7581,-318.1504,7.8438);//college
        return 1;
    }

else    if (strcmp("/exit", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 53.3778,-188.6606,998.3098 ))
        SetPlayerPos(playerid,-2665.6848,-7.8725,6.1328);
        return 1;
    }
else    if (strcmp("/exit", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, 772.111999,-3.898649,1000.728820))
        SetPlayerPos(playerid,-2717.7808,52.1632,4.3359);
        SetPlayerInterior(playerid, 0);//gym
        return 1;
    }
Only first enter and first exit works else give no response
Any help please?
Reply
#2

Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp(cmdtext,"/Command",true))
{
if(IsPlayerInRangeOfPoint(...)) SetPlayerPos(...);
else if(...)  SetPlayerPos(...);
else if(...)  SetPlayerPos(...);
else if(...)  SetPlayerPos(...);
else  SetPlayerPos(...);
return 1;
}
return 0;
}
Reply
#3

I didnt understand Please make it understandable.
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/enter", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -2718.7581,-318.1504,7.8438))
        {
            SetPlayerPos(playerid,-27.2596,-158.7045,1011.7094);
        }
        else if(IsPlayerInRangeOfPoint(playerid, 5.0, -2665.6848,-7.8725,6.1328 ))
        {
            SetPlayerPos(playerid,53.3778,-188.6606,998.3098);
        }
        else if(IsPlayerInRangeOfPoint(playerid,10.0,-2717.7808,52.1632,4.3359))
        {
            SetPlayerPos(playerid,772.111999,-3.898649,1000.728820);
            SetPlayerInterior(playerid, 5);//gym
        }
        if (strcmp("/exit", cmdtext, true, 10) == 0)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3.0, -27.2596,-158.7045,1011.7094 ))
            {
                SetPlayerPos(playerid,-2718.7581,-318.1504,7.8438);//college
            }
            else if(IsPlayerInRangeOfPoint(playerid, 3.0, 53.3778,-188.6606,998.3098 ))
            {
                SetPlayerPos(playerid,-2665.6848,-7.8725,6.1328);
            }
            else if(IsPlayerInRangeOfPoint(playerid, 5.0, 772.111999,-3.898649,1000.728820))
            {
                SetPlayerPos(playerid,-2717.7808,52.1632,4.3359);
                SetPlayerInterior(playerid, 0);//gym
            }
        }
        return 1;
    }
    return 1;
}
try this . .
Reply
#5

Hi, Daredevil, you can make a alone command which the name is "/enter". If this command make a lot of things, you use the conditions if, else if, else in the command.
Reply
#6

yea , im agree with ya kalel
Reply
#7

Devil XZ97 that also don't work.
Reply
#8

Do it the way devil did it always works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)