PDA

View Full Version : TP Command Problem


ChuckyBabe
22/04/2014, 03:27 AM
Hello, i have a command /loungeenter but everytime i type it, it tp'ing me to the default not in the position i want here's my current code hope you can fix this..

CMD:loungeenter(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 13.0, -4398.9072, 870.9648, 986.3803))
{
if(PlayerInfo[playerid][pDonator] >= 0)
{
SetPlayerPos(playerid, -2636.7969,1403.7454,907.6803);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have entered the the VIP Lounge!");
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pVW] = 0;
}
}
return 1;
}

I mean if i type /loungeenter it doesn't tp'ing me to the position i want

Stinged
22/04/2014, 03:33 AM
You set the interior and virtual work before setting the position.

ChuckyBabe
22/04/2014, 03:35 AM
Nevermind it i already solve it because -2636.7969,1403.7454,907.6803 this is not a interior 0 that is interior 3 that's why

Flake.
22/04/2014, 03:55 AM
Also your code

if(PlayerInfo[playerid][pDonator] >= 0) You do realise that'll let anyone inside the VIP lounge right?

ChuckyBabe
22/04/2014, 05:24 AM
Also your code

if(PlayerInfo[playerid][pDonator] >= 0) You do realise that'll let anyone inside the VIP lounge right?

Yes don't mind it.. I have a dynamic door that don't allow not donator to enter.

Flake.
22/04/2014, 05:46 AM
Yes don't mind it.. I have a dynamic door that don't allow not donator to enter.

Then why even run the check?

ChuckyBabe
22/04/2014, 06:39 AM
Then why even run the check?

Nothing just want to have a long code :)


P.S = How to make it for vips 1 up only ?

itsCody
22/04/2014, 06:50 AM
you could try if(PlayerInfo[playerid][pDonator] < 1) if it don't work just use if(PlayerInfo[playerid][pDonator] >= 1)

PrivatioBoni
22/04/2014, 07:03 AM
Nothing just want to have a long code :)


That goes against every fundamental programming rule there is. But whatever makes you happy. :)