What's wrong with this script?
#1

pawn Код:
forward step1(playerid);
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,0);
// Komandas
    if(gTeam[playerid] == komanda1) {
    SetPlayerColor(playerid,DZELTANS); // Pirma komanda - Sarkana
        }
    else if(gTeam[playerid] == komanda2) {
    SetPlayerColor(playerid,SARKANS); // Otra komanda - Zila
        }
// Pamaciba
    {
    SetPlayerPos(playerid,3759.3091,-1411.2380,4.2778);
    SetPlayerFacingAngle(playerid, 233.0);
    SetPlayerCameraPos(playerid,3714.0308,-1372.3802,24.3491);
    SetPlayerCameraLookAt(playerid,3759.3091,-1411.2380,4.2778);
    SendClientMessage(playerid,SARKANS,"-------------------");
    SendClientMessage(playerid,DZELTANS,"Yo, si ir pamaciba :D");
    SendClientMessage(playerid,SARKANS,"-------------------");
    TogglePlayerControllable(playerid, 0);
    SetTimer("step1", 5000, 0);
    return 1;
    }
}
pawn Код:
public step1(playerid)
{
    SendClientMessage(playerid, DZELTANS, "Pamaciba beigusies");
    TogglePlayerControllable(playerid, 1);
    if(gTeam[playerid] = komanda1)
            {
                SetPlayerPos(playerid,3632.3020,-1604.2275,16.7541);
                return 1;
            }
    if(gTeam[playerid] = komanda2)
            {
                SetPlayerPos(playerid,3972.4431,-1438.9698,15.6065);
                return 1;
            }
    return 1;
}

When i spawn, tutorial is starting.. After 5 sec, it should go to next step (Public step1), but nothing happens.. public step1 is not starting..
Reply
#2

Ok, I spotted as soon as i saw your code what was wrong!

You didnt set a timer to start part 2
Reply
#3

Quote:
Originally Posted by Torran
Ok, I spotted as soon as i saw your code what was wrong!

You didnt set a timer to start part 2
And what's this?
pawn Код:
SetTimer("step1", 5000, 0);
Reply
#4

Try to use SetTimerEx and see if that works? :P
Reply
#5

Oh i didnt see that,
But if its a tutorial i dont recommend using that code..
Reply
#6

pawn Код:
public step1(playerid)
{
SendClientMessage(playerid, DZELTANS, "Pamaciba beigusies");
TogglePlayerControllable(playerid, 1);
if(gTeam[playerid] == komanda1)
{
SetPlayerPos(playerid,3632.3020,-1604.2275,16.7541);
return 1;
}
    if(gTeam[playerid] == komanda2)
{
SetPlayerPos(playerid,3972.4431,-1438.9698,15.6065);
return 1;
}
return 1;
}
Reply
#7

Still not working.. There is something wrong about timer. Also SetTimerEx is not working.
EDIT: I found what's problem. That callback is working only for player with ID 0. Why?
Reply
#8

Have you treid this:

pawn Код:
public step1(playerid)
{
SendClientMessage(playerid, DZELTANS, "Pamaciba beigusies");
TogglePlayerControllable(playerid, 1);
if(gTeam[playerid] == komanda1)
{
SetPlayerPos(playerid,3632.3020,-1604.2275,16.7541);
}
 if(gTeam[playerid] == komanda2)
{
SetPlayerPos(playerid,3972.4431,-1438.9698,15.6065);
}
}
I dont return 1; in all the callbacks that i have made and they work so maybe try that? Idk might not make a difference but idkl= try it
Reply
#9

Quote:

EDIT: I found what's problem. That callback is working only for player with ID 0. Why?

Reply
#10

It should'nt be? It should be working for all,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)