City Is Not Changing!
#9

Quote:
Originally Posted by TuFF12
Посмотреть сообщение
still the same
nonononononoooooo.....
As said before, you restart your gamemode.
It does not matter if you first restart the gamemode and then change the variable, or if you use else if or if or else or nothing at all....
A restart of your gamemode will set all variables back to default! It is a "complete reset" for what is written in your gamemode, so changing a variable and then restarting the gamemode is basicly like not changing the variable...

If you are not familar with databases, you should start getting familar...

A simple way to do what you want is to use the default file functions
fopen https://sampwiki.blast.hk/wiki/Fopen
fclose https://sampwiki.blast.hk/wiki/Fclose
fwrite https://sampwiki.blast.hk/wiki/Fwrite
fread https://sampwiki.blast.hk/wiki/Fread

So instead updating the variable you'll save the new city in a file...

Код:
new File:store = fopen("nextcity.txt", io_write);
fwrite(store, "LasVenturas");   //For example... if changing it to another city, change the city name
fclose(store);
And then at "OnGameModeInit"
you use this to check what is written:
Код:
new File:store = fopen("nextcity.txt", io_read);
new string[100];
fread(store, string);
fclose(store);

if(!strcmp(string, "LasVenturas", true))
{
    //set to LV
}
else if(!strcmp(string, "SanFierro", true))
{
    //set to SF
}
else if(!strcmp(string, "LosSantos", true))
{
    //set to LS
}
else if.....
Reply


Messages In This Thread
City Is Not Changing! - by TuFF12 - 20.02.2016, 15:40
Re: City Is Not Changing! - by TuFF12 - 22.02.2016, 17:40
Re: City Is Not Changing! - by Nero_3D - 22.02.2016, 18:12
Re: City Is Not Changing! - by [eLg]elite - 22.02.2016, 18:12
Re: City Is Not Changing! - by TuFF12 - 22.02.2016, 18:26
Re: City Is Not Changing! - by [eLg]elite - 22.02.2016, 19:27
Re: City Is Not Changing! - by TuFF12 - 22.02.2016, 19:35
Re: City Is Not Changing! - by [eLg]elite - 22.02.2016, 20:11
Re: City Is Not Changing! - by Sascha - 22.02.2016, 20:13
Re: City Is Not Changing! - by TuFF12 - 24.02.2016, 18:52

Forum Jump:


Users browsing this thread: 1 Guest(s)