Code for VritualWorld
#1

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 ...
Reply
#2

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.
Reply
#3

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

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.
Reply
#5

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

Anybody?
Reply
#7

Use random numbers for the virtuel world variable .
Reply
#8

new g_iCompanies;

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

return g_iCompanies++;
}

and do not forget to save and load that g_iCompanies variable.
Reply
#9

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...
Reply
#10

Anybody?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)