Problem with Virtual World
#1

Hello!

I have a problem with virtual world, because when I in the car, I write /vworld 1 and i teleported to virtual world 1, but with no car.

Command is here:

if(strcmp(cmdtext, "/vworld 1", true) == 0)
{
if(GetPlayerScore(playerid) >= 13)
{
SetPlayerVirtualWorld(playerid, 1);
}
else if(IsPlayerInVehicle(playerid, cartype))
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SetVehicleVirtualWorld(cartype, 1);
PutPlayerInVehicle(playerid, cartype, 2);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You don't have 13th lvl");
}
return 1;
}

What is the problem? Sorry for my bad english. :S
Reply
#2

No.

When I in the car, I write /vworld 1 and I have set my virtual world 1, but with no car.
Reply
#3

Why not use

pawn Код:
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
and
pawn Код:
PutPlayerInVehicle(playerid,vehicleid,0);
Reply
#4

Please post the pwn code.

ex

pawn Код:
new vehicleid;
Quote my message you can see how it is.
Reply
#5

Try this

pawn Код:
if (strcmp("/vworld 1", cmdtext, true, 10) == 0)
    {
        if(GetPlayerScore(playerid) >= 13)
        {
           SetPlayerVirtualWorld(playerid, 1);
        }
        else if (IsPlayerInAnyVehicle(playerid))
        {
           SetPlayerVirtualWorld(playerid, 1);
        }
        else SendClientMessage(playerid, 0xffff00aa, "You must have 13 lvl.");
        return 1;
    }
I did not tested.

thanks
Reply
#6

Quote:
Originally Posted by Davz*|*Criss
Посмотреть сообщение
Try this

pawn Код:
if (strcmp("/vworld 1", cmdtext, true, 10) == 0)
    {
        if(GetPlayerScore(playerid) >= 13)
        {
           SetPlayerVirtualWorld(playerid, 1);
        }
        else if (IsPlayerInAnyVehicle(playerid))
        {
           SetPlayerVirtualWorld(playerid, 1);
        }
        else SendClientMessage(playerid, 0xffff00aa, "You must have 13 lvl.");
        return 1;
    }
I did not tested.

thanks
Unfortunately I have to disagree with your signature because you didn't get the point of this thread.

Try this code:
pawn Код:
if(strcmp(cmdtext, "/v world1", true) == 0)
{
    new car = GetPlayerVehicleID(car);
    new carid[MAX_PLAYERS];
    if(GetPlayerScore(playerid) >= 13)
    {
                          carid[playerid] = car; // Just in case the player is in a vehicle.
        SetPlayerVirtualWorld(playerid, 1);
        if(IsPlayerInVehicle(playerid, car) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            SetVehicleVirtualWorld(car, 1);
            PutPlayerInVehicle(playerid, car, 1);
        }
    } else {
        SendClientMessage(playerid, COLOR_GREY, "You are not level 13.");
        return 1;
    }
return 1;
}
Reply
#7

What you mean?

You have problem with my signature?

And this is not Offtopic don't make me spam.
Reply
#8

Biesmen

I try your command, but it still doesn't work :S
Reply
#9

Hm, I don't get it, I made an extra variable while that's unnecessarily.

Well, you could try to change those two lines:
pawn Код:
SetVehicleVirtualWorld(car, 1);            
PutPlayerInVehicle(playerid, car, 1);
into:

pawn Код:
SetVehicleVirtualWorld(carid[playerid], 1);            
PutPlayerInVehicle(playerid, carid[playerid], 1);
Reply
#10

Still doesn't work. :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)