SA-MP Forums Archive
Skip tut not working - 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: Skip tut not working (/showthread.php?tid=618660)



Skip tut not working - IndependentGaming - 08.10.2016

Hello, I have edited the skiptut command, but the problem is I can skip tut someone who is NOT inside a tutorial and I CAN'T skip someone who IS in side the tutorial.

++ I have added that if people spawn they will see the dialog but it isn't showing up at all

See command:

PHP код:
CMD:skiptut(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 4)
         return 
SendClientMessage(playeridCOLOR_GRAD1"You're not authorized to use that command!");
    if(
AdminDuty[playerid] != && PlayerInfo[playerid][pAdmin] < 6)
          return 
SendClientMessage(playerid,COLOR_WHITE"You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
          
    new
        
giveplayerid;
        
    if(
sscanf(params"u"giveplayerid))
        return 
SendClientMessage(playeridCOLOR_WHITE"USAGE: /skiptut [playerid/partofname]");
    if(
InsideTut[giveplayerid] >= 1) return SendClientMessage(playeridCOLOR_GRAD2"This player is not inside the tutorial!");
    if(
IsPlayerConnected(giveplayerid)) {
        for(new 
054t++) {
            
TextDrawHideForPlayer(giveplayeridTutTxtDraw[t]);
        }
        
SetPlayerInterior(giveplayerid0);
        
SetPlayerVirtualWorld(giveplayerid0);
        
TogglePlayerControllable(giveplayerid1);
        
SetPlayerPos(giveplayerid1773.459350, -1942.27343713.569922);
        
SetPlayerFacingAngle(giveplayerid329.64);
        
SetCameraBehindPlayer(giveplayerid);
        
InsideTut[giveplayerid] = 0;
        
DeletePVar(giveplayerid"MedicBill");
        
SetPlayerColor(giveplayerid,TEAM_HIT_COLOR);
        
PlayerInfo[giveplayerid][pTut] = 1;
        
PlayerInfo[giveplayerid][pSex] = 1;
        
PlayerInfo[giveplayerid][pAge] = 25;
        
        if(
PlayerInfo[giveplayerid][pSex] == 1) {
            
PlayerInfo[giveplayerid][pSkin] = 299;
        } else {
            
PlayerInfo[giveplayerid][pSkin] = 55;
        }
        
SetPlayerSkin(giveplayeridPlayerInfo[giveplayerid][pSkin]);
        
ClearChatbox(giveplayerid);
        new 
string[128];
        
format(stringsizeof(string), "Welcome to Red Label Roleplay, %s."GetPlayerNameEx(giveplayerid));
        
SendClientMessage(giveplayeridCOLOR_NEWSstring);
        
SetPVarInt(playerid"VehicleRefund"1);
        
SendClientMessageEx(playeridCOLOR_ORANGE"* You have been allowed one free vehicle! (/vrefund)");
        
format(stringsizeof(string), "~w~Welcome~n~~y~%s"GetPlayerNameEx(giveplayerid));
        
GameTextForPlayer(giveplayeridstring50001);
        
ShowPlayerDialogEx(playerid,231991,DIALOG_STYLE_MSGBOX,"{FF8040}WELCOME{FFFFFF}""Welcome to Red Label Roleplay, if you have any further question feel free to ask them over /newb.\n\nIf you want one of our senior helpers to give you a tour around the server please use /requesthelp.","OK","");
        new
            
motdstring[128];
            
        
format(motdstringsizeof(motdstring), "News: %s"GlobalMOTD);
        
SendClientMessage(giveplayeridCOLOR_WHITEmotdstring);
        
        
DeletePVar(giveplayerid"IsFrozen");
        
TutorialProgress[giveplayerid] = 0;
    }
    return 
1;




Re: Skip tut not working - Mencent - 08.10.2016

Hello!

PHP код:
if(InsideTut[giveplayerid] >= 1) return SendClientMessage(playerid,COLOR_GRAD2,"This Player is not inside the tutorial!"); 
to
PHP код:
if(InsideTut[giveplayerid] < 1) return SendClientMessage(playeridCOLOR_GRAD2"This Player is not inside the tutorial!");