how to do this? zones
#1

how i make zones? like "SanAndreasZones" zones like that. example: i want whenver player is in world 1 or world 2 the whole zone will show name like "world 1" or "world 2". how i can name SanAndreasZones by world?
Reply
#2

you mean VirtualWorld ?
wiki.sa-mp.com/wiki/SetPlayerVirtualWorld
Reply
#3

pawn Код:
if (strcmp(cmdtext, "/world3", true) == 0)
{
    SetPlayerVirtualWorld(playerid, 3);////this 3 want to say virtual world 3
    return 1;
}
pawn Код:
if (strcmp(cmdtext, "/world4", true) == 0)
{
    SetPlayerVirtualWorld(playerid, 4);////this 3 want to say virtual world 4, and you can edit it :)
    return 1;
}
Reply
#4

hi guys i have command i just need wen i are in world 1 or world 2 it will show my location/zone for "World 1" or "World 2".
Reply
#5

use https://sampwiki.blast.hk/wiki/GetPlayerVirtualWorld
to get the players world

the do a switch or if check and see if its world 1 or 2 ect...
and then use the zone code like normal inside the if
Reply
#6

sorry im noob. how i make inside if?
Reply
#7

i would go this route

pawn Код:
new pVW = GetPlayerVirtualWorld(playerid);
switch (pVW)
{
    case 1,2: //<~~add your worlds here
    {
        //add your zone code here
        //use zones for world 1 and 2
    }
    default:
    {
        //dont use zone code
    }

}
Reply
#8

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
i would go this route

pawn Код:
new pVW = GetPlayerVirtualWorld(playerid);
switch (pVW)
{
    case 1,2: //<~~add your worlds here
    {
        //add your zone code here
        //use zones for world 1 and 2
    }
    default:
    {
        //dont use zone code
    }

}
okay thank . i see case 1, 2 . but does case 1 means world 1? and if i want WHOLE world to be called something like i want whole world 1 to be called world 1 , how i do that?
Reply
#9

in this example pVW holds the players virtural world
so if their VW is 1 or 2 then you would use your zone code

i suggest you read here
https://sampwiki.blast.hk/wiki/Scripting_Basics
to understand how switch, if all that works

the second question i dont understand what you mean?
do you mean like a textdraw that says the worlds name?
you can use the same logic above for that also
just make a TD for each world and show the correct one
according to the world the player is in
Reply
#10

okay i kind of still dont get sorry

pawn Код:
new pVW = GetPlayerVirtualWorld(playerid);
switch (pVW)
{
    case 1: //<~~add your worlds here
    {
        //add your zone code here (idk what it mean)
        //use zones for world 1 and 2 (idk what this mean)
    }
    default:
    {
        //where do i put here?
    }

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)