help Expanding on Game mode changer
#1

Hay ive just made a game mode changer for my server
but i want it to change game modes more than once so heres my script (part)

public GMswitch()
{
SendRconCommand("changemode FALLOUT");
return 1;
}

#endif

but the only thing iss i can only change it to one thing i cant even change it back can i make it random or somthing like that so it can change sseveral times instead of once and then stick on that mode? (must be automatic
Reply
#2

new rand[gamemodenumberhere][2]
rand lalala ect
Reply
#3

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
new rand[gamemodenumberhere][2]
rand lalala ect
I doubt this will help him on his knowledgelevel (nothing against you tommie.. we all started with knowing a little only)
Reply
#4

Quote:
Originally Posted by Sascha
Посмотреть сообщение
I doubt this will help him on his knowledgelevel (nothing against you tommie.. we all started with knowing a little only)
true, but wiki.sa-mp.com is pwnage xd
Reply
#5

LOL dw i managed to decode the last persons jibberish n i no what he means anyway i made a few scripts but not meny or random things in them but ill ask ou to for help muhahahaha
Reply
#6

Hay ive made a game mode changer for my server or trying to as you can see above but ive got a new problam when the script runs it change to the mayor all the time which is the starting script help

// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

new mode;
forward GMswitch();

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" GamemodeChanger");
print("--------------------------------------\n");
return 1;
}

public OnGameModeInit()
{
SetTimer("GMswitch",30000,true);
}
public GMswitch()
{
mode = random(1);
SendRconCommand("changemode The_Mayor");
return 1;

mode = random(2);
SendRconCommand("changemode FALLOUT");
return 1;
}
#endif

the script hass 2 warnings

C:\Users\Brad\Desktop\MINI MISSIONS\filterscripts\GamemodeChanger.pwn(30) : warning 225: unreachable code
C:\Users\Brad\Desktop\MINI MISSIONS\filterscripts\GamemodeChanger.pwn(30) : warning 204: symbol is assigned a value that is never used: "mode"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.

help the script is desperatly needed to get on going with my server which is going on forums its jut to refresh my memory on how to script theres 2 modes there but i have 124 ready and waithing for the code names anyway while im waiting im scripting more things to go on it but this is needed or the erver will never be completed i wont realse the name its gonna have i dont want to pol the suprise
Reply
#7

First of all: Thanks for the compliment in the PM you've sent me. ^^

Okey, so lets start with the code:

- This is the Filterscript you need:
pawn Код:
#include <a_samp>
#include <dini>

public OnFilterScriptInit()
{
    SetTimer("GMswitch", 30000, 1);
    return 1;
}

forward GMswitch();
public GMswitch()
{
    new gm=strval(dini_Get("GameMode.txt", "LoadNext"));
    switch(gm)
    {
        case 0: { SendRconCommand("changemode FALLOUT"); gm++; }
        case 1: { SendRconCommand("changemode ANOTHER"); gm++; }
        case 2: { SendRconCommand("changemode ANOTHERONE"); gm++; }
        case 3: { SendRconCommand("changemode ONEMORE"); gm++; }
        case 4: { SendRconCommand("changemode DUNNOOOOO"); gm=0; }
    }
    new msg[10]; format(msg, 10, "%d", gm);
    dini_Set("GameMode.txt", "LoadNext", msg);
    return 1;
}
And as you can see, we have at the top #include <dini>. We need the include, to read the next gamemode out of a file.
You have to download "dini" (Just search it on ******).

Before you load the filterscript, you have to create at: /scriptfiles/ a file called: GameMode.txt

When you have done this, just change the GameModes to your ones, and you are done.

If you have any questions, just let me know, and I will help you.


Greetings,
Jeffry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)