Need help with tutorial.
#1

I'm making a tutorial and need help with this issue.

Quote:

C:\Users\Ethan\Desktop\samp02Xserver.win32\pawno\i nclude\cps.inc(140) : warning 208: function with tag result used before definition, forcing reparse
C:\Users\Ethan\Desktop\samp02Xserver.win32\gamemod es\crp.pwn(3261) : error 028: invalid subscript (not an array or too many subscripts): "Tutorial"
C:\Users\Ethan\Desktop\samp02Xserver.win32\gamemod es\crp.pwn(3261) : warning 215: expression has no effect
C:\Users\Ethan\Desktop\samp02Xserver.win32\gamemod es\crp.pwn(3261) : error 001: expected token: ";", but found "]"
C:\Users\Ethan\Desktop\samp02Xserver.win32\gamemod es\crp.pwn(3261) : error 029: invalid expression, assumed zero
C:\Users\Ethan\Desktop\samp02Xserver.win32\gamemod es\crp.pwn(3261) : fatal error 107: too many error messages on one line

This is what I have..
Quote:

if(strcmp(cmd, "/Tutorial", true) == 0)
{
TogglePlayerControllable(playerid, 0);
Tutorial[playerid] = 1;
SetTimerEx("Tutorial", 1000, 1);

if(Tutorial[playerid] == 1)
{
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] BLAHBLAH??");
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] BLEETBLEET");
SetPlayerPos(playerid, 974.0024,-1537.4017,73.0980);
SetPlayerCameraPos(playerid, 974.0024,-1537.4017,73.0980);
SetPlayerCameraLookAt(playerid, 1320.8724,-1409.4318,104.8676);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid,0);
Tutorial[playerid] = 2;
}
else if(Tutorial[playerid] == 2)
{
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] Message2??");
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] Message2again??");
return 1;
}
}

I know I didn't finish realeasing my togglecontrollable, but I got this error I want to fix first.
Reply
#2

Show as your 3261 line please

Ecko
Reply
#3

Quote:
Originally Posted by .::: [E
Ecko :::. ]
Show as your 3261 line please

Ecko
Quote:

if(strcmp(cmd, "/Tutorial", true) == 0)
{
TogglePlayerControllable(playerid, 0);
Tutorial[playerid] = 1;
SetTimerEx("Tutorial", 1000, 1);

if(Tutorial[playerid] == 1)
{
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] BLAHBLAH??");
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] BLEETBLEET");
SetPlayerPos(playerid, 974.0024,-1537.4017,73.0980);
SetPlayerCameraPos(playerid, 974.0024,-1537.4017,73.0980);
SetPlayerCameraLookAt(playerid, 1320.8724,-1409.4318,104.8676);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid,0);
Tutorial[playerid] = 2;
}
else if(Tutorial[playerid] == 2)
{
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] Message2??");
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] Message2again??");
return 1;
}
}

Reply
#4

pawn Код:
if(strcmp(cmd, "/Tutorial", true) == 0)
{
    TogglePlayerControllable(playerid, 0);
    Tutorial[playerid] = 1;
    SetTimerEx("Tutorial", 1000, 1);
}
   
if(Tutorial[playerid] == 1)
{
    SendClientMessage(playerid,COLOR_YELLOW2,"Tutorial text");
    SendClientMessage(playerid,COLOR_YELLOW2,"Tutorial text");
    SetPlayerPos(playerid, 974.0024,-1537.4017,73.0980);
    SetPlayerCameraPos(playerid, 974.0024,-1537.4017,73.0980);
    SetPlayerCameraLookAt(playerid, 1320.8724,-1409.4318,104.8676);    
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid,0);
    Tutorial[playerid] = 2;
}
else if(Tutorial[playerid] == 2)
{
    SendClientMessage(playerid,COLOR_YELLOW2,"Tutorial text ");
    SendClientMessage(playerid,COLOR_YELLOW2,"Tutorial text");
    return 1;
}
NOTE: You must have
pawn Код:
public Tutorial(playerid)
to change tutorial[playerid] to 0 if player wants to watch the tutorial again,back him virtual world & interior.
Reply
#5

I'm sorry to keep bothering you, but I'm trying hard to figure it out with the advice you've given me.
I'm still getting errors.
Quote:

forward Tutorial();

Quote:

public Tutorial(playerid)
{
if(Tutorial[playerid] == 2)
{
Tutorial[playerid] = 0;
return 1;
}
}

public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
new tmp[256];
new giveplayerid;
new giveplayer[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
//====================================(/locate system)
if(strcmp(cmd, "/Tutorial", true) == 0)
{
TogglePlayerControllable(playerid, 0);
Tutorial[playerid] = 1;
SetTimerEx("Tutorial", 1000, 0);
}
if(Tutorial[playerid] == 1)
{
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] BLAHBLAH??");
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] BLEETBLEET");
SetPlayerPos(playerid, 974.0024,-1537.4017,73.0980);
SetPlayerCameraPos(playerid, 974.0024,-1537.4017,73.0980);
SetPlayerCameraLookAt(playerid, 1320.8724,-1409.4318,104.8676);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid,0);
Tutorial[playerid] = 2;
}
else if(Tutorial[playerid] == 2)
{
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] Message2??");
SendClientMessage(playerid,COLOR_YELLOW2,"[TUTORIAL:] Message2again??");
return 1;
}

Reply
#6

You have a variable and a function of the same name "Tutorial":

pawn Код:
Tutorial[playerid] = 1;
    SetTimerEx("Tutorial", 1000, 1);
Reply
#7

Yeah go figure you'd answer. I just read a post you made over a year ago with the solution. Thanks twice I guess. (Vitual Kudos)
Reply
#8

No problemo dude, glad to help twice
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)