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



ZCMD - WiseRice - 26.12.2012

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/enter", cmdtext, true, 6) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10,1480.9829,-1769.9470,18.795)
{
SetPlayerPos(playerid,388.8720,173.8050,1008.382 ;
return 1;
} //other enter commands go here if(player......
}
if (strcmp("/exit", cmdtext, true, 6) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10,388.8720,173 .8050,1008.382)
{
SetPlayerPos(playerid,1480.9829,-1769.9470,18.795;
return 1;
} //other exit commands go here if(player......
}
}

Im Using ZCMD but i want this to work but this command gives me a warning can you help me please?

Quote:

warning 209: function "zcmd_OnPlayerCommandText" should return a value

This Line that the warning shows is the last } at the end


Re: ZCMD - Lynn - 26.12.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/enter", cmdtext, true, 6) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,10,1480.9829,-1769.9470,18.795)
        {
            SetPlayerPos(playerid,388.8720,173.8050,1008.382 ;
            return 1;
        } //other enter commands go here if(player......
    }
    if (strcmp("/exit", cmdtext, true, 6) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,10,388.8720,173 .8050,1008.382)
        {
            SetPlayerPos(playerid,1480.9829,-1769.9470,18.795;
            return 1;
        } //other exit commands go here if(player......
    }
    return 1;
}
Also, those commands are not written in Zcmd...
So you're not really using ZCMD at all.

This is how it would look in ZCMD
pawn Код:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid,10,1480.9829,-1769.9470,18.795)
    {
        SetPlayerPos(playerid,388.8720,173.8050,1008.382 ;
        return 1;
    } //other enter commands go here if(player......
    return 1;
}
CMD:exit(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid,10,388.8720,173 .8050,1008.382)
    {
        SetPlayerPos(playerid,1480.9829,-1769.9470,18.795;
        return 1;
    } //other exit commands go here if(player......
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}