SA-MP Forums Archive
Code for VritualWorld - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Code for VritualWorld (/showthread.php?tid=483076)



Code for VritualWorld - shulk - 24.12.2013

Hey,

im maked the Company System, when i want to make a company i want different virtualworld on all companies.(Sorry for bad english).
MY CODE:
CreateCompany( GetFreeCompanySlot( ), X, Y, Z, PlayerInfoEx[ playerid ][ CompanyToEdit_STYLE ], THE VIRTUAL WORLD, PlayerInfoEx[ playerid ][ CompanyToEdit_PRICE ] );
How can i make the VritualWorld on creating going : 0 , 1 , 2 ...


Re: Code for VritualWorld - SilentSoul - 24.12.2013

https://sampwiki.blast.hk/wiki/SetPlayerVirtualWorld
https://sampwiki.blast.hk/wiki/GetPlayerVirtualWorld
For each company increase the last number you made for SetPlayerVirtual world +1.


Re: Code for VritualWorld - shulk - 24.12.2013

Forget the VirtualWorld man, i just want code that returns : 0 on other company 1, on other 2...


Re: Code for VritualWorld - SilentSoul - 24.12.2013

Sorry i didn't get you , you made this system in-game company maker ? you want different virtual worlds for each company so here's an example
pawn Код:
CreateCompany( GetFreeCompanySlot( ), X, Y, Z, PlayerInfoEx[ playerid ][ CompanyToEdit_STYLE ], 1, PlayerInfoEx[ playerid ][ CompanyToEdit_PRICE ] );//Virtual world 1.
CreateCompany( GetFreeCompanySlot( ), X, Y, Z, PlayerInfoEx[ playerid ][ CompanyToEdit_STYLE ], 2, PlayerInfoEx[ playerid ][ CompanyToEdit_PRICE ] );//Different Virtual world 2. and so on.



Re: Code for VritualWorld - shulk - 24.12.2013

You didn't get me too.
Im creating Companys dynamic. I need code like 'GetFreeCompanySlot()' making 0,1,2,3,4 for each company.


Re: Code for VritualWorld - shulk - 25.12.2013

Anybody?


Re : Code for VritualWorld - [HRD]Mar1 - 25.12.2013

Use random numbers for the virtuel world variable .


Re: Code for VritualWorld - theYiin - 25.12.2013

new g_iCompanies;

stock CreateCompany(...)
{
// your code

return g_iCompanies++;
}

and do not forget to save and load that g_iCompanies variable.


Re: Code for VritualWorld - shulk - 25.12.2013

I put this new randomnum = random(100) + 1;
And when i put like this: CreateCompany( GetFreeCompanySlot( ), X, Y, Z, PlayerInfoEx[ playerid ][ CompanyToEdit_STYLE ], randomnum, PlayerInfoEx[ playerid ][ CompanyToEdit_PRICE ] );
I create the Compani and i cant see label and text, i can see it on 2 second after that it destroy it.
But when i put GetPlayerVirtualWorld(); it works...


Re: Code for VritualWorld - shulk - 25.12.2013

Anybody?