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



Help - 123bob123 - 19.08.2014

How can I change this style to Zcmd style, if you can please help me.

pawn Код:
#include <a_samp>

new ArmyGate;

public OnFilterScriptInit()
{
    ArmyGate = CreateObject(976, 2719.94775, -2409.93262, 12.45680, 0.00000, 0.00000, 90.00000, 100.0);
}

main()
{
    print("\n----------------------------------");
    print(" Gatetest Loaded");
    print("----------------------------------\n");
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/open ag", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680)){
            MoveObject(ArmyGate, 2719.94775, -2401.17456, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
            return 1;
        }
    }
    else if(!strcmp(cmdtext, "/close ag", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680)){
            MoveObject(ArmyGate, 2719.94775, -2409.93262, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
            return 1;
        }
    }
    return 0;
}

public OnFilterScriptExit()
{
    return 1;
}



Re: Help - CoCo06 - 19.08.2014

pawn Код:
#include <a_samp>
#include <zcmd>


new ArmyGate;

public OnFilterScriptInit()
{
     ArmyGate = CreateObject(976, 2719.94775, -2409.93262, 12.45680, 0.00000, 0.00000, 90.00000, 100.0);
}

main()
{
     print("\n----------------------------------");
     print(" Gatetest Loaded");
     print("----------------------------------\n");
}


CMD:open ag (playerid , params[])
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680))
  {
   MoveObject(ArmyGate, 2719.94775, -2401.17456, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
   return 1;
  }
}

CMD:close ag(playerid , params[])
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680))
  {
   MoveObject(ArmyGate, 2719.94775, -2409.93262, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
   return 1;
  }
}


public OnFilterScriptExit()
{
    return 1;
}



Re: Help - Gogorakis - 19.08.2014

Here you go:

Код:
#include <a_samp>
#include <zcmd>

new ArmyGate;

public OnFilterScriptInit()
{
    ArmyGate = CreateObject(976, 2719.94775, -2409.93262, 12.45680, 0.00000, 0.00000, 90.00000, 100.0);
}

main()
{
    print("\n----------------------------------");
    print(" Gatetest Loaded");
    print("----------------------------------\n");
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

CMD:openag(playerid, params[])
{
       if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680)){
       MoveObject(ArmyGate, 2719.94775, -2401.17456, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
       return 1;
}
CMD:closeag(playerid, params[])
{
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680)){
        MoveObject(ArmyGate, 2719.94775, -2409.93262, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
        return 1;
}



Re: Help - DobbysGamertag - 20.08.2014

The post above is missing a closing bracket on each command.


Re: Help - 123bob123 - 20.08.2014

Quote:
Originally Posted by CoCo06
Посмотреть сообщение
pawn Код:
#include <a_samp>
#include <zcmd>


new ArmyGate;

public OnFilterScriptInit()
{
     ArmyGate = CreateObject(976, 2719.94775, -2409.93262, 12.45680, 0.00000, 0.00000, 90.00000, 100.0);
}

main()
{
     print("\n----------------------------------");
     print(" Gatetest Loaded");
     print("----------------------------------\n");
}


CMD:open ag (playerid , params[])
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680))
  {
   MoveObject(ArmyGate, 2719.94775, -2401.17456, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
   return 1;
  }
}

CMD:close ag(playerid , params[])
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680))
  {
   MoveObject(ArmyGate, 2719.94775, -2409.93262, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
   return 1;
  }
}


public OnFilterScriptExit()
{
    return 1;
}
pawn Код:
gamemodes\Rpbob.pwn(903) : error 001: expected token: "(", but found "-identifier-"
amemodes\Rpbob.pwn(903) : error 001: expected token: ";", but found "("
gamemodes\Rpbob.pwn(905) : error 010: invalid function or declaration
gamemodes\Rpbob.pwn(908) : error 010: invalid function or declaration
gamemodes\Rpbob.pwn(912) : error 001: expected token: "(", but found "-identifier-"
\gamemodes\Rpbob.pwn(912) : error 001: expected token: ";", but found "("
gamemodes\Rpbob.pwn(914) : error 010: invalid function or declaration
\gamemodes\Rpbob.pwn(917) : error 010: invalid function or declaration
gamemodes\Rpbob.pwn(640) : warning 204: symbol is assigned a value that is never used: "ArmyGate"
help


Re: Help - 123bob123 - 20.08.2014

help?


Re: Help - Ahmad45123 - 20.08.2014

pawn Код:
#include <a_samp>
#include <zcmd>

new ArmyGate;

public OnFilterScriptInit()
{
    ArmyGate = CreateObject(976, 2719.94775, -2409.93262, 12.45680, 0.00000, 0.00000, 90.00000, 100.0);
}

main()
{
    print("\n----------------------------------");
    print(" Gatetest Loaded");
    print("----------------------------------\n");
}

CMD:openag(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680)) {
        MoveObject(ArmyGate, 2719.94775, -2401.17456, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
        return 1;
    }
}

CMD:closeag(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680)) {
        MoveObject(ArmyGate, 2719.94775, -2409.93262, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
        return 1;
    }
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}

public OnFilterScriptExit()
{
    return 1;
}
Notice that I removed the space's from the cmd's


Re: Help - 123bob123 - 20.08.2014

Quote:
Originally Posted by Ahmad45123
Посмотреть сообщение
pawn Код:
#include <a_samp>
#include <zcmd>

new ArmyGate;

public OnFilterScriptInit()
{
    ArmyGate = CreateObject(976, 2719.94775, -2409.93262, 12.45680, 0.00000, 0.00000, 90.00000, 100.0);
}

main()
{
    print("\n----------------------------------");
    print(" Gatetest Loaded");
    print("----------------------------------\n");
}

CMD:openag(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680)) {
        MoveObject(ArmyGate, 2719.94775, -2401.17456, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
        return 1;
    }
}

CMD:closeag(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680)) {
        MoveObject(ArmyGate, 2719.94775, -2409.93262, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
        return 1;
    }
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}

public OnFilterScriptExit()
{
    return 1;
}
Notice that I removed the space's from the cmd's
pawn Код:
function "cmd_closeag" should return a value
function "cmd_closeag" should return a value



Re: Help - Gogorakis - 20.08.2014

Try this:
Код:
#include <a_samp>
#include <zcmd>

new ArmyGate;

public OnFilterScriptInit()
{
    ArmyGate = CreateObject(976, 2719.94775, -2409.93262, 12.45680, 0.00000, 0.00000, 90.00000, 100.0);
}

main()
{
    print("\n----------------------------------");
    print(" Gatetest Loaded");
    print("----------------------------------\n");
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

CMD:openag(playerid, params[])
{
       if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680))
       {
       MoveObject(ArmyGate, 2719.94775, -2401.17456, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
       }
       return 1;
}
CMD:closeag(playerid, params[])
{
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 2719.94775, -2409.93262, 12.45680))
        {
        MoveObject(ArmyGate, 2719.94775, -2409.93262, 12.45680, 3.0, 0.00000, 0.00000, 90.00000);
        }
        return 1;
}
I am not sure..