Free World Don't Work
#1

Stock:
pawn Код:
stock WorldLibero(worldid)
{
if(worldid==0)return false;
for(new i = 0; i < MAX_PLAYERS; i++)
if(GetPlayerVirtualWorld(i) == worldid)
return false;
return true;
}
This don't set the world free at player:

pawn Код:
.......
    if(IsPlayerInAnyVehicle(playerid)) { DestroyVehicle(GetPlayerVehicleID(playerid)); }
        new n=1;
        while(!WorldLibero(n))
        n++;
        TogglePlayerControllable(playerid,false);
.......
Reply
#2

Look at your "for" loop in "stock WorldLibero(worldid)".
It has no beginning and ending.
Reply
#3

ehm?
Reply
#4

Sorry i don't stand. Please help
Reply
#5

I do not understand, explain what you do ... if you can not English well, write in Romanian,
Reply
#6

do you mean like virtual world?
Reply
#7

Quote:
Originally Posted by exDDDD
Посмотреть сообщение
I do not understand, explain what you do ... if you can not English well, write in Romanian,
Chiar daca nu stie engleza nu are voie sa vorbeasca romana aici, sa foloseasca un translator.

EN: Even if he dosen't know english, he ain't allowed to talk romanian here, he should use an translator.
Reply
#8

pawn Код:
stock WorldLibero(worldid)
{
    if(worldid==0)return false;
    for(new i = 0; i < MAX_PLAYERS; i++) // Here you start a loop, but where does it start and where does it end?
    //  {
    if(GetPlayerVirtualWorld(i) == worldid) /* break removed */ return false;
    //  }
    return true;
}
The same with the while-loop in your second code snippet.

https://sampwiki.blast.hk/wiki/Loops

If it's at all possible to run a loop without start/end tag you should write it all in one row, I think.
Reply
#9

pawn Код:
.......
    if(IsPlayerInAnyVehicle(playerid)) { DestroyVehicle(GetPlayerVehicleID(playerid)); }
        new n=1;
        while(!WorldLibero(n))
        n++;
        SetPlayerVirtualWorld(playerid, n);
        TogglePlayerControllable(playerid,false);
.......
Reply
#10

Ok but however the braces miss in the second snippet..

pawn Код:
if(IsPlayerInAnyVehicle(playerid)) { DestroyVehicle(GetPlayerVehicleID(playerid)); }
        new n=1;
        while(!WorldLibero(n))
        {
            n++;
            TogglePlayerControllable(playerid,false);
        }
or not?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)