PDA

View Full Version : OnKeyStateChange [REP++++]


nezo2001
04/02/2015, 11:34 PM
I made a command to create business, Then when i create the business it info saved as

BusinessInfo = 6.091179; //WhatEver
BusinessInfo[id][bExitY] = 6.091179; //WhatEver
BusinessInfo[id][bExitZ] = 6.091179; //WhatEver
BusinessInfo[id][bInsideInt] = 2; //WhatEver

Then under OnKeyStateChange
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_SECONDARY_ATTACK) && !(oldkeys & KEY_SECONDARY_ATTACK))
{
for(new x = 0; x < sizeof(BusinessInfo);x++)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, BusinessInfo[x][bEntranceX],BusinessInfo[x][bEntranceY],BusinessInfo[x][bEntranceZ]))
{
SetPlayerPos(playerid, BusinessInfo[x][bExitX],BusinessInfo[x][bExitY],BusinessInfo[x][bExitZ]);
SetPlayerVirtualWorld(playerid, BusinessInfo[x][bInsideWorld]);
}
}
}

return 1;
}
I tried to set the player interior as saved in the business info i got the same result
http://i.imgur.com/FLFgdhC.png
[B][I]REP+++

izeatfishz
04/02/2015, 11:40 PM
Add my skype - izeatfishz

Alternative112
04/02/2015, 11:43 PM
I think you need to use SetPlayerInterior instead of SetPlayerVirtualWorld in line 10. I am presuming bInsideInt is the interior ID of the business, which is completely different from Virtual worlds.

nezo2001
04/02/2015, 11:51 PM
As i said i added
SetPlayerInterior(playerid,BusinessInfo[i][bInsideInt]);
And i got the same problem

nezo2001
05/02/2015, 12:03 AM
lol i worked REP