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



Comand help - Jordiee - 18.11.2011

Ok guys, this command
Код:
CMD:skiptut(playerid, params[])
{
if(pInTut[playerid] == 1)
{
SetPlayerPos(playerid, -201.4800, 1121.3499, 19.7422);
SetPlayerFacingAngle(playerid, 274.1669);
SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to CityHall as the tutorial is bugged.");
}
else
{
SendClientMessage(playerid,COLOR_RED, "You are not in a tutorial that you can skip!");
}
return 1;
it just keeps saying that you aren't in a tut that you can skip, and I was in the tutorial


Re: Comand help - Kostas' - 18.11.2011

I am not sure about this
pawn Код:
CMD:skiptut(playerid, params[])
{
    if(pInTut[playerid] == 1) {
        SetPlayerPos(playerid, -201.4800, 1121.3499, 19.7422);
        SetPlayerFacingAngle(playerid, 274.1669);
        SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to CityHall as the tutorial is bugged.");
    }
    else return SendClientMessage(playerid,COLOR_RED, "You are not in a tutorial that you can skip!");
}



Re: Comand help - Jordiee - 18.11.2011

Код:
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(10842) : warning 209: function "cmd_skiptut" should return a value



Re: Comand help - SmiT - 18.11.2011

Make sure when you type the command your pInTut variable is equal to 1 -
pawn Код:
CMD:skiptut(playerid, params[])
{
    if ( pInTut[ playerid ] == 1) {
        SetPlayerPos(playerid, -201.4800, 1121.3499, 19.7422);
        SetPlayerFacingAngle(playerid, 274.1669);
        SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to CityHall as the tutorial is bugged.");
    }
    else return SendClientMessage(playerid,COLOR_RED, "You are not in a tutorial that you can skip!");
   
    return 1;
}



Re: Comand help - Danyal - 18.11.2011

pawn Код:
CMD:skiptut(playerid, params[])
{
if(pInTut[playerid] == 1)
{
SetPlayerPos(playerid, -201.4800, 1121.3499, 19.7422);
SetPlayerFacingAngle(playerid, 274.1669);
SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to CityHall as the tutorial is bugged.");
}
else
{
SendClientMessage(playerid,COLOR_RED, "You are not in a tutorial that you can skip!");
}
return 1;
}



Re: Comand help - Kostas' - 18.11.2011

Quote:
Originally Posted by Jordiee
Посмотреть сообщение
Код:
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(10842) : warning 209: function "cmd_skiptut" should return a value
Whoops! I forgot to return it.


Re: Comand help - Jordiee - 18.11.2011

still says it :/


Re: Comand help - Kostas' - 18.11.2011

I tested it and compiles for me without errors/warnings.
pawn Код:
CMD:skiptut(playerid, params[])
{
    if (pInTut[playerid] == 1) {
        SetPlayerPos(playerid, -201.4800, 1121.3499, 19.7422);
        SetPlayerFacingAngle(playerid, 274.1669);
        SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to CityHall as the tutorial is bugged.");
    }
    else return SendClientMessage(playerid,COLOR_RED, "You are not in a tutorial that you can skip!");
    return 1;
}



Re: Comand help - SmiT - 18.11.2011

I don't see anything wrong, are you sure pInTut variable is equal to 1 when you type the command?
pawn Код:
CMD:skiptut(playerid, params[])
{
    printf("pInTut = %d", pInTut[ playerid ] );
   
    if ( pInTut[ playerid ] == 1) {
        SetPlayerPos(playerid, -201.4800, 1121.3499, 19.7422);
        SetPlayerFacingAngle(playerid, 274.1669);
        SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to CityHall as the tutorial is bugged.");
    }
    else return SendClientMessage(playerid,COLOR_RED, "You are not in a tutorial that you can skip!");
   
    return 1;
}
See the output.


Re: Comand help - Jordiee - 18.11.2011

still says im not in a tut that I can't skip.