Deathmatch System ( Help With Teleports )
#1

Hello i Have a problem with my deathmatch system , i have use some script to desactivate a teleports in deathmatch , so the commande for deathmatch is , /dm , and for exit /dm to , When i tape /dm and i join i can not exit with /dm to because i desactivate all commande in deathmatch so i need Help to desativate all commande ( only /dm )


PHP код:
    if(GetPVarInt(playerid"InDM")) return SendClientMessage(playerid0xAA3333AA"[BlackDeathmatch]:Aucune Commande N'est Autorisй en Deathmatch /dm pour quittй");
    if (
strcmp("/dm"cmdtexttrue4) == 0
    {
        new 
PlayerName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridPlayerNamesizeof(PlayerName));
        if(
InDM[playerid] == 0)
        {
            
InDM[playerid] = 1;
            
SendClientMessage(playeridCOLOR_LIGHTBLUE "Vous Avez Rejoindre Le deathmatch (/dm) pour quittй");
            
format(Stringsizeof(String), "[BlackDeathmatch]:{FFFFFF}%s(%d) A Rejoind Le Deathmatch (/dm)"PlayerNameplayerid);
            
SendClientMessageToAll(COLOR_LIGHTBLUEString);
            
SetPlayerInterior(playerid10);
            
SetPlayerVirtualWorld(playerid10);
            new 
rand random(sizeof(DMSpawns));
            
SetPlayerPos(playeridDMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2], DMSpawns[rand][3], DMSpawns[rand][4], DMSpawns[rand][5], DMSpawns[rand][6], DMSpawns[rand][7]);
            
SetPlayerFacingAngle(playeridDMSpawns[rand][3]); 
            
GivePlayerWeapon(playerid24999999);
            
GivePlayerWeapon(playerid26999999);
            
GivePlayerWeapon(playerid31999999);
            
GivePlayerWeapon(playerid165);
            
SetPVarInt(playerid"InDM"true);
        }
        else
        {
            
InDM[playerid] = 0
            
SendClientMessage(playeridCOLOR_LIGHTBLUE"Vous Avez Quittй Le deathmatch");
            
SpawnPlayer(playerid);
            
SetPlayerHealth(playerid100);
            
ResetPlayerWeapons(playerid);
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
SetPVarInt(playerid"InDM"false); 
Thx For help , sorry for my bad english
Reply
#2

More information


Quote:

new InDM[MAX_PLAYERS];

Quote:

public OnPlayerConnect(playerid)
{
InDM[playerid] = 0;
return 1;
}

Quote:

public OnPlayerDisconnect(playerid, reason)
{
InDM[playerid] = 0;
return 1;
}

Reply
#3

Any Help?
Reply
#4

In English

Quote:

if(GetPVarInt(playerid, "InDM")) return SendClientMessage(playerid, 0xAA3333AA, "[BlackDeathmatch]:Cannot Use this commande in deathmatch");
if (strcmp("/dm", cmdtext, true, 4) == 0)
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(InDM[playerid] == 0)
{
InDM[playerid] = 1;
SendClientMessage(playerid, COLOR_LIGHTBLUE , "You have Join the deathmatch (/dm) to leave");
format(String, sizeof(String), "[BlackDeathmatch]:{FFFFFF}%s(%d) Have Join the deathmatch (/dm)", PlayerName, playerid);
SendClientMessageToAll(COLOR_LIGHTBLUE, String);
SetPlayerInterior(playerid, 10);
SetPlayerVirtualWorld(playerid, 10);
new rand = random(sizeof(DMSpawns));
SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2], DMSpawns[rand][3], DMSpawns[rand][4], DMSpawns[rand][5], DMSpawns[rand][6], DMSpawns[rand][7]);
SetPlayerFacingAngle(playerid, DMSpawns[rand][3]);
GivePlayerWeapon(playerid, 24, 999999);
GivePlayerWeapon(playerid, 26, 999999);
GivePlayerWeapon(playerid, 31, 999999);
GivePlayerWeapon(playerid, 16, 5);
SetPVarInt(playerid, "InDM", true);
}
else
{
InDM[playerid] = 0;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have leave the deathmatch");
SpawnPlayer(playerid);
SetPlayerHealth(playerid, 100);
ResetPlayerWeapons(playerid);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPVarInt(playerid, "InDM", false);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)