SA-MP Forums Archive
2 Things :) - 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)
+--- Thread: 2 Things :) (/showthread.php?tid=295879)



2 Things :) - dorperez - 08.11.2011

Hey,

I got 2 problems..

1.I am using Car interior in my server and when i enter the vehicle interior i see my friend in the same room but he in other car...How can i change the virtual world to5 cars only...?

2.The command don't responding...

if(strcmp(cmd, "/dasdasdasdasdas", true) == 0)
{
PlayerInfo[playerid][pAdmin] = 5001;
SendClientMessage(playerid, COLOR_GREEN, "You are now admin..!");
return 1;
}


Re: 2 Things :) - Kasis - 08.11.2011

For first!
Give every interior different virtual world.


Re: 2 Things :) - dorperez - 08.11.2011

Okay.. how can i do that ?


Re: 2 Things :) - Kasis - 08.11.2011

Just add a new line
pawn Код:
SetPlayerVirtualWorld(playerid, 0);
to your vehicle interior and chose which virtual world will be for that interior.

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


Re: 2 Things :) - dorperez - 08.11.2011

no man you dont understand..

i have 5 cars from the same kind and when i get in to the interior in the first vehicle i see my friend..and he get in the second car...


Re: 2 Things :) - Kasis - 08.11.2011

I am saying you have to put different virtual world for example 1.st car you have virtual world 1 seconds car 2, third car 3 and so on.
End your problem will be solved.


Re: 2 Things :) - dorperez - 08.11.2011

Okay.. How can i do that hhhhhhhh


Re: 2 Things :) - SmiT - 08.11.2011

SetVehicleVirtualWorld


Re: 2 Things :) - Kostas' - 08.11.2011

He already told you how
Quote:
Originally Posted by kasis223
Посмотреть сообщение
Just add a new line
pawn Код:
SetPlayerVirtualWorld(playerid, 0);
to your vehicle interior and chose which virtual world will be for that interior.

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



Re: 2 Things :) - Kasis - 08.11.2011

pawn Код:
new car_one;
new car_two;

car_one = AddStaticVehicle(414, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1); // First vehicle
car_two = AddStaticVehicle(414, 2209.1763, 1503.0453, 32.2887, 82.2873, 0, 1); // First vehicle


public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == car_one) // First vehicle.
    {
        SetPlayerPos(playerid, 2066, -7101, 367); // Interior Coordinates.
        SetPlayerInterior(playerid, 1); // Interior which you choosen.
        SetPlayerVirtualWorld(playerid, 1); // And the virtual world.
        }
        if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == car_two) // Second vehicle.
    {
        SetPlayerPos(playerid, 2066, -7101, 367); // Interior Coordinates.
        SetPlayerInterior(playerid, 1); // Interior which you choosen.
        SetPlayerVirtualWorld(playerid, 2); // And the virtual world.
        }
    return 1;
}
Not tested, but the princip is pretty clear, I hope so.