This site has been archived and made available for preservation purposes. No edits can be made.

Results 1 to 6 of 6

Thread: Blank-Mode

  1. #1

    Blank-Mode

    Hello, I'm releasing this Blank mode of mine, I can't test it though I'd be glad if someone could for me.

    Anyway, this gamemode is to show you how certain things are created, variables and stuff, basically a general concept of how pawn scripts can be created. I couldn't do what I really wished to do since there are hardly any functions, dammit, I may not have updated.

    I've added a coin system (Yes I know, it's EXTREMELY easy!) Though thats ment to show you the concept of creating variables and subtracting them, feel free to point out suggestions! I can try to add them. The includes I am using are the fairly old ones (last updated the includes was in JUNE)

    Removed some variables, found them worthless and just byte wasting, better off editing it rather than making a new string to input data inside.

    Loops are also included in the script, some usages on reseting a variable is there.

    Code C++:
    /*
     *
     *   	Cash script by Lorenc
     *
     *   Free to use and claim, just shows
     *    a Basic concept of creating
     *   Variables and how to manage them
     *
     *  	Version: 0.1b and supports nothing but console print messages.
     *
    */
    #include <vaultmp>
     
    #define playerid        clientID 		// 	Needed for me xD.
    #define MAX_PLAYERS       200     	//	CHANGE TO SERVER SLOTS!
    #define Variable:%1<%2> 		%1[%2 char]   // Efficent way of creating variables define by me
    #define MAX_PLAYER_NAME     24       // Don't know the limit!
    #define INVALID_PLAYER_ID    65535      // Hopefully this will take place in the invalid playerid action
     
    #define loopPlayers(%1)     for(new %1; %1 < MAX_PLAYERS; %1++) // Easy looping going through the MAX_PLAERS
     
    new
    	Variable:Money<MAX_PLAYERS>;
     
    stock ReturnPlayerName(playerid)
    {
    	new pName[MAX_PLAYER_NAME] = "Invalid Player ID"; 
    	if(playerid == INVALID_PLAYER_ID) return pName;
    	GetPlayerName(playerid, pName);
    	return pName;
    }
     
    main()
    {
    	timestamp();
     
    	SetServerName("My Vault MP server");
     
    	new map[14];
    	if (!IsNewVegas()) 	{ map = "the wasteland"; }
    	else 				{ map = "mojave desert"; }
     
    	SetServerMap(map); // The MAP string has been changed to a setting
     
    	SetServerRule("version", "0.1a"); // Sets the Version rule to 0.1a which it currently is
     
    	loopPlayers(i) { // Creates a loop, directing to all the player ID's used
        Money[i] = 0; // Resets the variable
      }
    }
     
    public OnClientAuthenticate(playerid, const name[], const pwd[])
    {
    	timestamp();
    	return 1;
    }
     
    public OnClientRequestGame(playerid, savegame[], len)
    {
    	timestamp();
    	return 1;
    }
     
    public OnPlayerJoin(playerid)
    {
    	timestamp();
    	printf("%s(%d) has joined the server!", ReturnPlayerName(playerid), playerid);
     
    	if(strlen(ReturnPlayerName(playerid)) > MAX_PLAYER_NAME)
    	{
    	  printf("%s(%d) has a name larger than "#MAX_PLAYER_NAME" and offically is a loser :P", ReturnPlayerName(playerid), playerid);
    		//Kick(playerid); // Theres no kick function!!!
    	}
    	return 1;
    }
     
    public OnPlayerDeath(playerid)
    {
    	timestamp();
    	printf("%s(%d) has died!", ReturnPlayerName(playerid), playerid);
     
    	if(Money[playerid] >= 1) {
    		Money[playerid] -= 1;
    		printf("%s(%d) has lost 1 dollar!", ReturnPlayerName(playerid), playerid);
    	}
    	return 1;
    }
     
    public OnPlayerDisconnect(playerid)
    {
    	timestamp();
    	printf("%s(%d) has left the server!", ReturnPlayerName(playerid), playerid);
    	return 1;
    }

    Indention may seem awful, nothing I can do. SMF doesn't auto Intend code.

    I modified not alot, but most of it.

    The coin system will not work!!! If you want it to work, you may need to wait for Recycler to create more server functions and update the MP. This is not a huge gamemode, this is just to get some general knowledge to creating a gamemode.

    Constructive Criticizem allowed.

    Somethings wrong? Post a reply, heads up and have a great day guys.


    - Lorenc

    PS: Heads up to people wanting to grab a compiler and a server developing kit, check the useful functions section!
    A gaming community ran by one person, with servers made by individuals (in this case, me, myself)
    I plan to look for a trusted person who will help me create a decent roleplay/deathmatch server on Vault-TEC,
    PM me if you're interested

  2. #2

    Re: Blank-Mode

    God work Lorenc_!

    Well done

  3. #3
    Senior Member Dantiko's Avatar
    Join Date
    Aug 2011
    Location
    São Carlos, Brazil
    Posts
    452

    Re: Blank-Mode

    "Theres no kick function!!!" made me laugh, good work Lorenc.
    "Only a few don't give up on games, and only a few give up on life"

  4. #4

    Re: Blank-Mode

    [quote author=Lorenc link=topic=76.msg435#msg435 date=1311342532]
    #define MAX_PLAYERS 200 // CHANGE TO SERVER SLOTS!
    #define Variable:%1<%2> %1[%2 char] // Efficent way of creating variables define by me
    #define loopPlayers(%1) for(new %1; %1 < MAX_PLAYERS; %1++) // Easy looping going through the MAX_PLAERS
    new Variable:Money<MAX_PLAYERS>;

    loopPlayers(i) { // Creates a loop, directing to all the player ID's used
    Money[i] = 0; // Resets the variable
    }
    [/quote]
    Pretty useless, creating variables there always 0. Also resetting it on main() makes no sense, you should reset em (Money[playerid]) on OnPlayerJoin(playerid). BTW a system saving the money for each player (filefunctions are pawn natives arent they?) would be nice

  5. #5

    Re: Blank-Mode

    [quote author=Phoenix link=topic=76.msg3346#msg3346 date=1318434345]
    [quote author=Lorenc link=topic=76.msg435#msg435 date=1311342532]
    #define MAX_PLAYERS 200 // CHANGE TO SERVER SLOTS!
    #define Variable:%1<%2> %1[%2 char] // Efficent way of creating variables define by me
    #define loopPlayers(%1) for(new %1; %1 < MAX_PLAYERS; %1++) // Easy looping going through the MAX_PLAERS
    new Variable:Money<MAX_PLAYERS>;

    loopPlayers(i) { // Creates a loop, directing to all the player ID's used
    Money[i] = 0; // Resets the variable
    }
    [/quote]
    Pretty useless, creating variables there always 0. Also resetting it on main() makes no sense, you should reset em (Money[playerid]) on OnPlayerJoin(playerid). BTW a system saving the money for each player (filefunctions are pawn natives arent they?) would be nice
    [/quote]

    They can return something other than null, depending on how much data is contained inside "Money"; If it exceeds '0xFF' (255) then it'll return either '-1' or '0xFFFF'... I may of forgot to reset it however, I also forgot to mention that, this variable uses a 8 bit array, max is number you can hold is '0xFF', without the char array, I think it's something like '0xFFFFFF', one large int

    It's been a while since this has been updated, since then, there was nothing special to do with vault-tec. I see that there is changes and I could script something more powerful then this... I'll make a file writer for the community sometime

    "July 22, 2011, 03:48:52 pm" < Date!
    A gaming community ran by one person, with servers made by individuals (in this case, me, myself)
    I plan to look for a trusted person who will help me create a decent roleplay/deathmatch server on Vault-TEC,
    PM me if you're interested

  6. #6

    Re: Blank-Mode

    [quote author=Lorenc link=topic=76.msg3364#msg3364 date=1318595527]"July 22, 2011, 03:48:52 pm" < Date![/quote]
    Ye, I´m sorry :P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •