Problem with Virtual World -
GrInDzO - 18.03.2011
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
Re: Problem with Virtual World -
GrInDzO - 18.03.2011
No.
When I in the car, I write /vworld 1 and I have set my virtual world 1, but with no car.
Re: Problem with Virtual World -
SchurmanCQC - 18.03.2011
Why not use
pawn Код:
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
and
pawn Код:
PutPlayerInVehicle(playerid,vehicleid,0);
Re: Problem with Virtual World -
Davz*|*Criss - 18.03.2011
Please post the pwn code.
ex
Quote my message you can see how it is.
Re: Problem with Virtual World -
Davz*|*Criss - 18.03.2011
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
Re: Problem with Virtual World -
Biesmen - 18.03.2011
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;
}
Re: Problem with Virtual World -
Davz*|*Criss - 18.03.2011
What you mean?
You have problem with my signature?
And this is not Offtopic don't make me spam.
Re: Problem with Virtual World -
GrInDzO - 18.03.2011
Biesmen
I try your command, but it still doesn't work :S
Re: Problem with Virtual World -
Biesmen - 18.03.2011
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);
Re: Problem with Virtual World -
GrInDzO - 18.03.2011
Still doesn't work. :S