HELP ME
#1

Hi i have 2 errors





Код:
	if(!strcmp("/stunt", cmdtext, true)) // 1 error line
{
	 pos = GetPlayerPos(playerid);
	 SetPlayerPos(playerid,4131.0371,310.5895,5.0703);
}
    if(!strcmp("/back", cmdtext, true))      // 2 error line
{
	  SetPlayerPos(playerid,pos);
}
Reply
#2

error 010: invalid function or declaration
error 010: invalid function or declaration
Reply
#3

try:
pawn Код:
if(!strcmp("/stunt", cmdtext, true) == 0) // 1 error line
{
     pos = GetPlayerPos(playerid);
     SetPlayerPos(playerid,4131.0371,310.5895,5.0703);
}
    if(!strcmp("/back", cmdtext, true) == 0)      // 2 error line
{
      SetPlayerPos(playerid,pos);
}
also which error are you having?
and where did you put that code?
Reply
#4

error 010: invalid function or declaration
error 010: invalid function or declaration

I put that to gamemode

your code don't work
Reply
#5

Код:
if(!strcmp("/stunt", cmdtext, true) == 0) // 1 error line
{
     new Float: X, Float: Y, Float:Z;
     GetPlayerPos(playerid, X, Y, Z);

     SetPlayerPos(playerid,4131.0371,310.5895,5.0703);
}
    if(!strcmp("/back", cmdtext, true) == 0)      // 2 error line
{
      SetPlayerPos(playerid, X, Y, Z);
}
Reply
#6

error 010: invalid function or declaration
error 021: symbol already defined: "GetPlayerPos"
error 021: symbol already defined: "SetPlayerPos"
error 010: invalid function or declaration

now i have
Reply
#7

add return 1; in the bottom of the each command.
Reply
#8

Код:
new
Float:aX[MAX_PLAYERS],
Float:aY[MAX_PLAYERS],
Float:aZ[MAX_PLAYERS]; // Global Variables

if(!strcmp("/stunt", cmdtext, true) == 0) // 1 error line
{
     GetPlayerPos(playerid, aX[playerid], aY[playerid], aZ[playerid]);

     SetPlayerPos(playerid,4131.0371,310.5895,5.0703);

     return 1;
}
    if(!strcmp("/back", cmdtext, true) == 0)      // 2 error line
{
      SetPlayerPos(playerid, ax[playerid], aY[playerid], aZ[playerid]);

      return 1;
}
Reply
#9

I would suggest you to use ZCMD:
https://sampforum.blast.hk/showthread.php?tid=91354
There are bunch of tutorials about how to create commands with it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)