Search

open.mp forum

RegisterLogin

Discussion

General
Chat
Tech
Life
Art
Programming
open.mp
Development Updates
Questions and Suggestions
SA-MP
General Discussions
Videos and Screenshots
Support
Pawn Scripting
Tutorials
Releases
Plugins
Libraries
Filterscripts
Gamemodes
Maps
Advertisements
Other languages
Spanish/Espa?ol
Programaci?n
Discusi?n GTA SA Multijugador
Mods
Offtopic
Juegos
Portuguese/Portugu?s
Russian/???????
Italian/Italiano
Dutch/Nederlands
German/Deutsch
Romanian/Rom?na
Ex-Yu
Polish/Polski
Og?lne
Serwery
Skryptowanie
Filmiki i zdjecia
Lithuanian/Lietuvi?kas
French/Fran?ais
Hungarian/Magyar
Hindi/Urdu
Turkish
Other
Internal
Team
Hidden
Archived

Library

 Collections Links Members Roles

Help with enter and exiting an interior

Hello Burgershot Community,

ID
d6ouivnilegovhg7btgg
author
xdk6's avatar

XDK6

@xdk6


View profile
Copy link
  Report member
started
Jun 28, 2021
replies
0
participating
No

scroll to top

powered by storyden

Login
Discussion
Pawn Scripting
Help with enter and exiting an interior
xdk6's avatar

XDK6

@xdk6


View profile
Copy link
  Report member
• 4y
Pawn Scripting

Help with enter and exiting an interior

pawn

Hello Burgershot Community,



I have a problem with my 3dtext label and exiting a property on my script. Whenever I exit the property it tp me to the first 24/7 store that I created instead of the new one.



here is the code I use on creating a property system with printing the ids on 3d text label



variables and enums:



#define MAX_STORES 500



enum sInfo

{

sID,

sType,

Text3D:sLabel,

sName[50],

sMapIcon,

sPickup,

Float:sX,

Float:sY,

Float:sZ,

sInt,

sVirt,

Float:intsX,

Float:intsY,

Float:intsZ,

sintInt,

sintVirt,

bool:sIDUsed

};



new storeinfo[MAX_STORES][sInfo];

new TotalStores;





Code for creating the store

createstore(storeid, type, Float:X, Float:Y, Float:Z, Float:IntX, Float:IntY, Float:IntZ, intInt, intVirt)

{

TotalStores;

storeinfo[storeid][sID] = storeid;

storeinfo[storeid][sX] = X;

storeinfo[storeid][sY] = Y;

storeinfo[storeid][sZ] = Z;

storeinfo[storeid][sInt] = 0;

storeinfo[storeid][sVirt] = 0;

storeinfo[storeid][intsX] = IntX;

storeinfo[storeid][intsY] = IntY;

storeinfo[storeid][intsZ] = IntZ;

storeinfo[storeid][sintInt] = intInt;

storeinfo[storeid][sintVirt] = intVirt;

intVirt = storeinfo[storeid][sID];

storeinfo[storeid][sIDUsed] = true;



storeinfo[storeid][sPickup] = CreateDynamicPickup(1272, 1, storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 0);



storeinfo[storeid][sType] = type;

new string2[128];

if(storeinfo[storeid][sType] == 1)

{

format(string2, sizeof(string2), "24/7 (ID:%d)", storeinfo[storeid][sName], storeinfo[storeid][sID]);

? ? ? ? storeinfo[storeid][sLabel] = Create3DTextLabel(string2, -1, storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 30.0, storeinfo[storeid][sVirt]);

for(new i = 0; i < MAX_PLAYERS; i)

? ? {

storeinfo[storeid][sMapIcon] = CreateDynamicMapIcon(storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 17, 1, 0, 0, i, 300, MAPICON_LOCAL);

}

}

if(storeinfo[storeid][sType] == 2)

{

format(string2, sizeof(string2), "Burgershot (ID:%d)", storeinfo[storeid][sName], storeinfo[storeid][sID]);

? ? ? ? storeinfo[storeid][sLabel] = Create3DTextLabel(string2, -1, storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 30.0, storeinfo[storeid][sVirt]);

for(new i = 0; i < MAX_PLAYERS; i)

? ? {

storeinfo[storeid][sMapIcon] = CreateDynamicMapIcon(storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 10, 1, 0, 0, i, 300, MAPICON_LOCAL);

}

}

if(storeinfo[storeid][sType] == 3)

{

format(string2, sizeof(string2), "Cluckin Bell (ID:%d)", storeinfo[storeid][sName], storeinfo[storeid][sID]);

? ? ? ? storeinfo[storeid][sLabel] = Create3DTextLabel(string2, -1, storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 30.0, storeinfo[storeid][sVirt]);

for(new i = 0; i < MAX_PLAYERS; i)

? ? {

storeinfo[storeid][sMapIcon] = CreateDynamicMapIcon(storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 14, 1, 0, 0, i, 300, MAPICON_LOCAL);

}

}

if(storeinfo[storeid][sType] == 4)

{

format(string2, sizeof(string2), "Well Stacked Pizza Co. (ID:%d)", storeinfo[storeid][sName], storeinfo[storeid][sID]);

? ? ? ? storeinfo[storeid][sLabel] = Create3DTextLabel(string2, -1, storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 30.0, storeinfo[storeid][sVirt]);

for(new i = 0; i < MAX_PLAYERS; i)

? ? {

storeinfo[storeid][sMapIcon] = CreateDynamicMapIcon(storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 29, 1, 0, 0, i, 300, MAPICON_LOCAL);

}

}

if(storeinfo[storeid][sType] == 5)

{

format(string2, sizeof(string2), "Binco (ID:%d)", storeinfo[storeid][sName], storeinfo[storeid][sID]);

? ? ? ? storeinfo[storeid][sLabel] = Create3DTextLabel(string2, -1, storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 30.0, storeinfo[storeid][sVirt]);

for(new i = 0; i < MAX_PLAYERS; i)

? ? {

storeinfo[storeid][sMapIcon] = CreateDynamicMapIcon(storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 45, 1, 0, 0, i, 300, MAPICON_LOCAL);

}

}

if(storeinfo[storeid][sType] == 6)

{

format(string2, sizeof(string2), "Zip (ID:%d)", storeinfo[storeid][sName], storeinfo[storeid][sID]);

? ? ? ? storeinfo[storeid][sLabel] = Create3DTextLabel(string2, -1, storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 30.0, storeinfo[storeid][sVirt]);

for(new i = 0; i < MAX_PLAYERS; i)

? ? {

storeinfo[storeid][sMapIcon] = CreateDynamicMapIcon(storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 45, 1, 0, 0, i, 300, MAPICON_LOCAL);

}

}

if(storeinfo[storeid][sType] == 7)

{

format(string2, sizeof(string2), "Pro-Laps (ID:%d)", storeinfo[storeid][sName], storeinfo[storeid][sID]);

storeinfo[storeid][sLabel] = Create3DTextLabel(string2, -1, storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 30.0, storeinfo[storeid][sVirt]);

for(new i = 0; i < MAX_PLAYERS; i)

? ? {

storeinfo[storeid][sMapIcon] = CreateDynamicMapIcon(storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 45, 1, 0, 0, i, 300, MAPICON_LOCAL);

}

}

if(storeinfo[storeid][sType] == 8)

{

format(string2, sizeof(string2), "Suburban (ID:%d)", storeinfo[storeid][sName], storeinfo[storeid][sID]);

storeinfo[storeid][sLabel] = Create3DTextLabel(string2, -1, storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 30.0, storeinfo[storeid][sVirt]);

for(new i = 0; i < MAX_PLAYERS; i)

? ? {

storeinfo[storeid][sMapIcon] = CreateDynamicMapIcon(storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 45, 1, 0, 0, i, 300, MAPICON_LOCAL);

}

}

if(storeinfo[storeid][sType] == 9)

{

format(string2, sizeof(string2), "Didier Sachs (ID:%d)", storeinfo[storeid][sName], storeinfo[storeid][sID]);

? ? ? ? storeinfo[storeid][sLabel] = Create3DTextLabel(string2, -1, storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 30.0, storeinfo[storeid][sVirt]);

for(new i = 0; i < MAX_PLAYERS; i)

? ? {

storeinfo[storeid][sMapIcon] = CreateDynamicMapIcon(storeinfo[storeid][sX], storeinfo[storeid][sY], storeinfo[storeid][sZ], 45, 1, 0, 0, i, 300, MAPICON_LOCAL);

}

}

new string[128];

format(string, sizeof(string), "Store ID: %d has been created. Total Stores: %d", storeid, TotalStores);

printf(string);

}





Enter and Exit code:



stock SendPlayerInsideStore(playerid, storeid)

{

if(storeid == MAX_STORES) return 0;

new Float:X = storeinfo[storeid][intsX], Float:Y = storeinfo[storeid][intsY], Float:Z = storeinfo[storeid][intsZ], Int = storeinfo[storeid][sintInt], Virt = storeinfo[storeid][sID];

SetPlayerPos(playerid, X, Y, Z);

SetPlayerInterior(playerid, Int);

SetPlayerVirtualWorld(playerid, Virt);

return 1;

}



stock SendPlayerOutsideStore(playerid, storeid)

{

if(storeid != MAX_STORES)

{

? ? ? ? new Float:X = storeinfo[storeid][sX], Float:Y = storeinfo[storeid][sY], Float:Z = storeinfo[storeid][sZ], Int = storeinfo[storeid][sInt];

SetPlayerPos(playerid, X, Y, Z);

SetPlayerInterior(playerid, Int);

SetPlayerVirtualWorld(playerid, 0);

}

else return 0;

return 1;

}
0 likes0 replies

    Please sign up or log in to reply