Little help in Making map change system
#1

HEY everyone , Before I had a map change , but I added the same stuffs in Public onPlayerSpawn(For players who just connected to the server) & Public onMapChange(For players who are already playing) so it's done two times & make the gm huge....
Now, I have some ideas how to make a simple map change without taking a lot of space in my GM :

1-There is a timer in OnGameModeInt for the Map change
pawn Код:
SetTimer("MapChange",1000,true);
2-
pawn Код:
forward MapChange();
public MapChange()
{
SecondesMap ++;
if(SecondesMap == 1)
{
print(" First gm");
}
else if(SecondesMap == 3)
{
print(" Secon MAP !!");
}
else if(SecondesMap == 6)
{
print(" Secon MAP !!");
SecondesMap=0;
}
}
everything is fine , but in a map change we must expect two things :
-the players who are already in the server .
-The player who just joined the server .

-The problem is I don't wanna repeat things two times , as u know we set teams/weapons... for already players & who just joined the server , so I decided to call a function like :
Public OnFirstMap()
{
}
but I can't add stuff like Kick(playerid) it says "playerid indifined"

I just ask how to make it easier , a map change that does its role one time , not two times...
Reply
#2

This tutorial would help you, ALOT! Link: https://sampforum.blast.hk/showthread.php?tid=269336
Reply
#3

Thank u a lot , but I even don't know it that system is 100% working without bugs , nvm I gonna try it...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)