[Trigger] one player in game - defeat

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
You can just check how many players are playing with conditions.

However, I think a nicer solution will be checking if the game is in Single Player (non-b.net) with this code

JASS:
local integer i = 0
if bj_isSinglePlayer == true then
    loop
        exitwhen i == GetPlayersAll()
        call CustomDefeatBJ(Player(i), "Single player is not allowed !")
        set i = i + 1
    endloop    
endif


You can just make this in GUI with custom scripts (write exacly like this, every line in a diffrent custom script).
 
Level 3
Joined
Jan 22, 2008
Messages
39
like this?

  • Trigger
    • Events
    • Conditions
    • Actionens
      • Custom script: local integer i = 0
      • Custom script: if bj_isSinglePlayer == true then
      • Custom script: loop
      • Custom script: exitwhen i == GetPlayersAll()
      • Custom script: call CustomDefeatBJ(Player(i), "Single player is not allowed !")
      • Custom script: set i = i + 1
      • Custom script: endloop
      • Custom script: endif
it doesn't work, it displays an error in "exitwhen i == GetPlayersAll()"
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Oh well, then just write it this way :p

JASS:
local integer i = 0
if bj_isSinglePlayer == true then
    loop
        exitwhen i = 11
        call CustomDefeatBJ(Player(i), "Single player is not allowed !")
        set i = i + 1
    endloop
endif

  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Custom script: local integer i = 0
      • Custom script: if bj_isSinglePlayer == true then
      • Custom script: loop
      • Custom script: exitwhen i = 11
      • Custom script: call CustomDefeatBJ(Player(i), "Single player is not allowed !")
      • Custom script: set i = i + 1
      • Custom script: endloop
      • Custom script: endif

Im not even sure if it needs to exit the loop as it defeats the player but, who knows. Maybe the game will crash even before defeating him lol.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
Why would you want such a dumb and stupid system you fool!

Simply do what all good RPGs do and disable the save/load system from functioning if only 1 human player is present. That way people like your map more, your map has a greater chance of being approved and no one can cheat. You can do this by counting the number of human players that are present and if they equal 1 then disabling the triggers that handle saving and loading.

bj_isSinglePlayer == true also does not stop cheating, as they could make a LAN game and hack them selves a hero of strong power by using a memory editor which is totally legal as they are not using it online.

Also implimenting a single player kick system is asking for your map to be ripped and ruined (people have a reason to do so) and that kind of trigger is insainly easy to edit and disable no matter how well you try and protect your map.
 
Level 3
Joined
Jan 22, 2008
Messages
39
hey i just found that trigger on an unprotected RPG map it looks like this

  • No Singleplayer
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: if bj_isSinglePlayer then
      • Custom script: call EndGame(true)
      • Custom script: endif

and it works *YAY* :xxd:

thanks anyway :grin: im happy now :thumbs_up:
 
Level 3
Joined
Jan 22, 2008
Messages
39
Why would you want such a dumb and stupid system you fool!

Simply do what all good RPGs do and disable the save/load system from functioning if only 1 human player is present. That way people like your map more, your map has a greater chance of being approved and no one can cheat. You can do this by counting the number of human players that are present and if they equal 1 then disabling the triggers that handle saving and loading.

bj_isSinglePlayer == true also does not stop cheating, as they could make a LAN game and hack them selves a hero of strong power by using a memory editor which is totally legal as they are not using it online.

Also implimenting a single player kick system is asking for your map to be ripped and ruined (people have a reason to do so) and that kind of trigger is insainly easy to edit and disable no matter how well you try and protect your map.

i dont think so, disabling the save/load trigger is a possibility but you can cheat then anyway and see the whole map and check everything
and yes maybe you can "hack" everymap anyway but i dont think the most know how to ^^ so i think my map is saver that way now

P.S. i'am not a fool :wink:
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I think he actually called my a fool but whatever.

It would look something like this
  • Untitled Trigger 154.24
    • Events
      • Map initialization
    • Conditions
      • (Number of players in (All players controlled by a User player)) Equal to 1
    • Actions
      • Trigger - Turn off yourLoadTrigger
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
OmegaOne, I am sorry if you misunderstood what I was saying. My post was trying to be perswasive rather than critisising you. I purly used the "fool" part to grab your attention and to increase the strength of the argument against such a system, I did not mean it to be a direct insult.

Thus I am sorry if I offended you as it was not aimed to be insultive. It was just to try and convince you there are better ways to stop single player cheating in save / load RPGs.
 
Level 3
Joined
Jan 22, 2008
Messages
39
i just dont get it, doesn't matter what i try, i think that trigger doesnt count the player in game but the player that are possible in my map
so i have 8 possible player, if i set equal to 8 then it disables the save trigger
 
Status
Not open for further replies.
Top