SA-MP Forums Archive
Virtual World - 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: Virtual World (/showthread.php?tid=268707)



Virtual World - Jack- - 13.07.2011

How do you make it so that if a player is in a different virtual world you cant see any of there commands or messages?


Re: Virtual World - farris - 13.07.2011

use getplayervirtualworld for both players and if its different add a return 1;


Re: Virtual World - Wesley221 - 13.07.2011

pawn Код:
for( new i = 0; i < MAX_PLAYERS; i++ )
{
    if(GetPlayerVirtualWorld(i) != GetPlayerVirtualWorld(i)) return 0;
}
Add this to OnPlayerText, not sure if it works: worth a try


Re: Virtual World - Conroy - 13.07.2011

^ That makes no sense....

If the virtual world of a player doesnt equal the virtual world of the same player, return 0? WTF?

Time for you to go back to scripting basics

pawn Код:
public OnPlayerText(playerid, text[])
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
        {
            SendClientMessage(i, COLOR_WHITE, text);
        }
    }
    return 0;
}



Re: Virtual World - farris - 13.07.2011

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
pawn Код:
for( new i = 0; i < MAX_PLAYERS; i++ )
{
    if(GetPlayerVirtualWorld(i) != GetPlayerVirtualWorld(i)) return 0;
}
Add this to OnPlayerText, not sure if it works: worth a try
isnt (i) standing for playerid, you still need to get the targetid :P


Re: Virtual World - Wesley221 - 13.07.2011

Quote:
Originally Posted by Conroy
Посмотреть сообщение
^ That makes no sense....

If the virtual world of a player doesnt equal the virtual world of the same player, return 0? WTF?

Time for you to go back to scripting basics

pawn Код:
public OnPlayerText(playerid, text[])
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
        {
            SendClientMessage(i, COLOR_WHITE, text);
        }
    }
    return 0;
}
I just woke up, no need to rage immediately