Free World Don't Work - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Free World Don't Work (
/showthread.php?tid=220522)
Free World Don't Work -
SamyRomafia - 03.02.2011
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);
.......
AW: Free World Don't Work -
!Phoenix! - 03.02.2011
Look at your "for" loop in "stock WorldLibero(worldid)".
It has no beginning and ending.
Re: Free World Don't Work -
SamyRomafia - 03.02.2011
ehm
?
Re: Free World Don't Work -
SamyRomafia - 04.02.2011
Sorry i don't stand. Please help
Re: Free World Don't Work -
exDDDD - 04.02.2011
I do not understand, explain what you do ... if you can not English well, write in Romanian,
Re: Free World Don't Work -
hadzx - 04.02.2011
do you mean like virtual world?
Re: Free World Don't Work -
AlExAlExAlEx - 04.02.2011
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.
AW: Free World Don't Work -
!Phoenix! - 04.02.2011
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.
Re: Free World Don't Work -
MadeMan - 04.02.2011
pawn Код:
.......
if(IsPlayerInAnyVehicle(playerid)) { DestroyVehicle(GetPlayerVehicleID(playerid)); }
new n=1;
while(!WorldLibero(n))
n++;
SetPlayerVirtualWorld(playerid, n);
TogglePlayerControllable(playerid,false);
.......
AW: Free World Don't Work -
!Phoenix! - 04.02.2011
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?