[PROBLEM] CMD
#1

I get this

Код:
../gamemodes/OnPlayerCommandZCMD.pwn(3599) : error 010: invalid function or declaration
../gamemodes/OnPlayerCommandZCMD.pwn(3603) : error 010: invalid function or declaration
pawn Код:
}
CMD:sup(playerid, params[])
{
    if(GetPlayerState(playerid) == 1)
    {
         if(PlayerToPoint(5.0,playerid,242.7591,66.4315,1003.6406))
         {
                SetPlayerPos(playerid, 619.0756,-566.6477,26.1432);
                GameTextForPlayer(playerid, "~b~Sheriff Roof",5000,1);
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid,0);
            }
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
    }
    return 1;
}
Reply
#2

Point out the lines please? Where exactly is: 3599 and where is: 3603
Reply
#3

Which lines have the errors ?

Edit : too late.
Reply
#4

pawn Код:
CMD:sup(playerid, params[])
{
    if(GetPlayerState(playerid) == 1)
    {
         if(PlayerToPoint(5.0,playerid,242.7591,66.4315,1003.6406))
         {
                SetPlayerPos(playerid, 619.0756,-566.6477,26.1432);
                GameTextForPlayer(playerid, "~b~Sheriff Roof",5000,1);
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid,0);
            }
        }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
    }
    return 1;
}
Try this.
Reply
#5

pawn Код:
}
CMD:sup(playerid, params[])
{
    if(GetPlayerState(playerid) == 1)
    {
         if(PlayerToPoint(5.0,playerid,242.7591,66.4315,1003.6406))
         {
                SetPlayerPos(playerid, 619.0756,-566.6477,26.1432);
                GameTextForPlayer(playerid, "~b~Sheriff Roof",5000,1);
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid,0);
            }
        }
    }
    line 3599 else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
    }
    line 3603 return 1;
}
Reply
#6

Quote:
Originally Posted by zombieking
Посмотреть сообщение
pawn Код:
CMD:sup(playerid, params[])
{
    if(GetPlayerState(playerid) == 1)
    {
         if(PlayerToPoint(5.0,playerid,242.7591,66.4315,1003.6406))
         {
                SetPlayerPos(playerid, 619.0756,-566.6477,26.1432);
                GameTextForPlayer(playerid, "~b~Sheriff Roof",5000,1);
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid,0);
            }
        }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
    }
    return 1;
}
Try this.
I get same errors.
Reply
#7

Try this;

pawn Код:
CMD:sup(playerid, params[])
{
    if(GetPlayerState(playerid) == 1)
    {
         if(PlayerToPoint(5.0,playerid,242.7591,66.4315,1003.6406))
         {
                SetPlayerPos(playerid, 619.0756,-566.6477,26.1432);
                GameTextForPlayer(playerid, "~b~Sheriff Roof",5000,1);
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid,0);
            }
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
        return 1;
    }
}
Reply
#8

I tested the code I gave... And it worked , obviously the errors are not on that lines

@Jhero: The code you gave prompts this error :
pawn Код:
error 010: invalid function or declaration
Reply
#9

Quote:
Originally Posted by Jhero
Посмотреть сообщение
Try this;

pawn Код:
CMD:sup(playerid, params[])
{ // 1
    if(GetPlayerState(playerid) == 1)
    { // 2
         if(PlayerToPoint(5.0,playerid,242.7591,66.4315,1003.6406))
         { // 3
                SetPlayerPos(playerid, 619.0756,-566.6477,26.1432);
                GameTextForPlayer(playerid, "~b~Sheriff Roof",5000,1);
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid,0);
            } // 1
        } // 2
    } // 3
    else
    { // 4 - this is outside of the actual command
        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
        return 1;
    } // 4 - this is outside of the actual command
}
As you can see above that doesn't seem to even work at all just by the looks of it.
Reply
#10

Just test my code... It will surely work , I tested it myself
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)