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



New Command - Cheynoa - 23.03.2013

Код:
	COMMAND:opensdgate(playerid)
	{
	for (new i = 0; i < APPROX_PLAYERS; i++)
	 {
	   if (IsPlayerConnected(i) )
	   {
	     if(gteam[i]==Team_LSPD)
		 { // BCSO PARKING
		 MoveObject(pd1, -232.99, 1214.82, 20.01, 2 ,0.00, 0.00, 180.06);
		 MoveObject(pd2, -232.95, 1214.88, 20.01, 2 ,0.00, 0.00, 180.06);
         }
         }
	return 1;
    }
I get these errors when compiling:
(3677 : error 029: invalid expression, assumed zero
(3677 : error 017: undefined symbol "cmd_opensdgate"
(3677 : error 029: invalid expression, assumed zero
(3677 : fatal error 107: too many error messages on one line


Re: New Command - Dzines4SAMP - 23.03.2013

What command processor are you using?


Re: New Command - Cheynoa - 23.03.2013

Quote:
Originally Posted by Dzines4SAMP
Посмотреть сообщение
What command processor are you using?
D Command


Re: New Command - Gamer_007 - 23.03.2013

Quote:
Originally Posted by Cheynoa
Посмотреть сообщение
D Command
DCMD?If you are using DCMD,try this

pawn Код:
dcmd_opensdgate(playerid,params[])
{
    for (new i = 0; i < APPROX_PLAYERS; i++)
     {
       if (IsPlayerConnected(i) )
       {
         if(gteam[i]==Team_LSPD)
         { // BCSO PARKING
         MoveObject(pd1, -232.99, 1214.82, 20.01, 2 ,0.00, 0.00, 180.06);
         MoveObject(pd2, -232.95, 1214.88, 20.01, 2 ,0.00, 0.00, 180.06);
         }  
       }
     }
     return 1;
}
And under OnPlayercommandText add this

pawn Код:
dcmd(opensdgate,10,cmdtext);



Re: New Command - Cheynoa - 23.03.2013

OnPlayerCommandText isn't scripted in to the script.


Re: New Command - Gamer_007 - 23.03.2013

So add it.Btw Can you tell us correctly which command processor are uusing?


Re: New Command - sniperwars - 23.03.2013

The error line was:

pawn Код:
COMMAND:opensdgate(playerid)
This line should be:

pawn Код:
COMMAND:opensdgate(playerid, params[])
So you can try this:

pawn Код:
COMMAND:opensdgate(playerid, params[])
{
    for (new i = 0; i < APPROX_PLAYERS; i++)
    {
       if(IsPlayerConnected(i))
       {
         if(gteam[i]==Team_LSPD)
         { // BCSO PARKING
            MoveObject(pd1, -232.99, 1214.82, 20.01, 2 ,0.00, 0.00, 180.06);
            MoveObject(pd2, -232.95, 1214.88, 20.01, 2 ,0.00, 0.00, 180.06);
         }
    }
    return 1;
}