Efficient Map Changing System...
#1

Hello,
I want a efficient Map Changing System, not with Timer, but with a amount of kills.
I have two teams, Team Blue and Team Red, the first one to achieve the kills will win the round and another map will start. EX: %d/50.
I've been using Timer with my Map changing system but it isint efficient + it is very poorly scripted.
So if someone can help me with it.
It will be appreciated muchly.
Thanks.
Reply
#2

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(PlayerInfo[killerid][Team] == 1)
    {
        TeamKills[PlayerInfo[killerid][Team]]++
        if(TeamKills[PlayerInfo[killerid][Team]] => 50)
        {
            //Code to change map.
        }
    }
}
This is just a example of how it would work.
Reply
#3

I got the part on how to make scoring system for team thanks for that, but i also asked for an Map Changing System ( An Efficient One ) because the one i made is with Timers and they get bugged all the time.
Thanks.
EDIT: Also, to announce which team won.
Reply
#4

When a score reaches for example 50, then change the map. I don't have your code..I can't do it for you.
Reply
#5

.....
I'm here asking for a map changing system mate (well an efficient one). And you are saying 'Change The Map' ..?
Reply
#6

This is not the appropriate section...

https://sampforum.blast.hk/showthread.php?tid=187229
Reply
#7

Quote:
Originally Posted by Extremo
View Post
This is not the appropriate section...

https://sampforum.blast.hk/showthread.php?tid=187229
Thank you for posting, you just gained 1 post.
Now how about you help me?...
Reply
#8

Right,

You are requesting us to make you an efficient map changing system are you not? Well this isn't the section for that. if however you're just asking what you need in order to make an efficient map changing system? Simple:

pawn Code:
new Tickets[MAX_TEAMS];

public OnPlayerDeath(playerid, killerid, reason)
{
    // check if guy is in team
    if(playerid == team)
    {
         Tickets[team]--;
    }
    for(new i = 0; i < MAX_TEAMS; i++)
    {
        if(!Tickets[i]) ChangeMap();
}
No timer involved, all you do is count the tickets on death which you would have anyway and you then check if one of the teams has reached zero tickets - and change the map. How else would you be doing it? You could obviously if you believe that those couple nanoseconds are too much on every kill, simply write a multithreaded plugin that holds your tickets and you call a native everytime that calculates the tickets internally and calls the callback on ProcessTick that one team has run out of tickets, but I highly doubt that is necessary.

The rest is up to you. We are not here to make the scripts for you but to point you in the right direction =).

Regards.
Reply
#9

dafuq did i just read?
however, thanks.
I got it, i guess.
Reply
#10

Quote:
Originally Posted by Littlehelper[MDZ]
View Post
dafuq did i just read?
however, thanks.
I got it, i guess.
I'd be glad to explain any confusion I may have caused you. Where exactly I am I misunderstood at? If you didn't understand any of what I just said that's fine as well I can try in a different way. Absolutely no problem =).

Just point me to the place where you stopped following me and I'll try and explain.

Regards.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)