28.05.2013, 06:17
Hi everyone, i was wondering if its possible to make toggable objects. What I mean, if you type /hideobjects all objects are going to get Destroyed (hide) and when you type /showobjects objects are going to Created (show)
I made some test but it will take me a lot of time to make it by this way due to i have lots of maps:
Is there any way to create it with 1 variable?
Thanks in advanced
I made some test but it will take me a lot of time to make it by this way due to i have lots of maps:
pawn Код:
forward ShowObject(playerid);
public ShowObject(playerid)
{
Object1[playerid] = CreateObject(16430,-975.29998779,528.00000000,169.60000610,0.00000000,328.00000000,46.00000000, 300.0);//object(des_ebrigroad02) (4)
Object2[playerid] = CreateObject(16430,-881.40002441,625.20001221,254.10000610,0.00000000,327.99682617,45.99975586, 300.0);//object(des_ebrigroad02) (5)
Object3[playerid] = CreateObject(16430,-776.09997559,733.59997559,378.79998779,0.00000000,327.99682617,45.99975586, 300.0);//object(des_ebrigroad02) (6)
Object4[playerid] = CreateObject(16430,-683.90002441,828.50000000,502.29998779,0.00000000,327.99682617,45.99975586, 300.0);//object(des_ebrigroad02) (7)
Object5[playerid] = CreateObject(16430,-590.40002441,925.40002441,586.59997559,0.00000000,327.99682617,45.99975586, 300.0);//object(des_ebrigroad02) (8)
Object6[playerid] = CreateObject(16430,-503.00000000,1016.40002441,695.50000000,0.00000000,327.99682617,45.99975586, 300.0);//object(des_ebrigroad02) (9)
Object7[playerid] = CreateObject(16430,-410.60000610,1112.19995117,807.50000000,0.00000000,327.99682617,45.99975586, 300.0);//object(airprtcrprk02_lvs) (1)
Object8[playerid] = CreateObject(8040,-242.00000000,1286.90002441,935.50000000,0.00000000,0.00000000,226.00000000, 300.0);//object(des_ebrigroad02) (9)
Object9[playerid] = CreateObject(16430,-316.70001221,1209.50000000,892.00000000,0.00000000,327.99682617,45.99975586, 300.0);//object(landjump2) (12)
Object10[playerid] = CreateObject(1634,-1017.90002441,478.29998779,130.50000000,330.00000000,0.00000000,136.00000000, 300.0);//object(landjump2) (15)
Object11[playerid] = CreateObject(1634,-1020.79998779,481.10000610,130.50000000,330.00000000,0.00000000,136.00003052, 300.0);//object(landjump2) (17)
Object12[playerid] = CreateObject(1634,-1023.59997559,483.89999390,130.50000000,329.99633789,0.00000000,135.99975586, 300.0);
return 1;
}
forward HideObject(playerid);
public HideObject(playerid)
{
DestroyObject(Object1[playerid]);
DestroyObject(Object2[playerid]);
DestroyObject(Object3[playerid]);
DestroyObject(Object4[playerid]);
DestroyObject(Object5[playerid]);
DestroyObject(Object6[playerid]);
DestroyObject(Object7[playerid]);
DestroyObject(Object8[playerid]);
DestroyObject(Object9[playerid]);
DestroyObject(Object10[playerid]);
DestroyObject(Object11[playerid]);
DestroyObject(Object12[playerid]);
return 1;
}
Thanks in advanced