DM Arena bugs [2 problems]
#1

Hello,how can i set the DM arena to not give Wanted levels if you kill someone inside the arena (Very anoying),and how can I set to /napustidm(leavedm) without killing the player.To respawn him or something (Killing is in conflict with my /kill CMD).Thanks in advance who helps me

Код:
//***************************xxxSpeedxxx's DM ARENA FS**************************
//#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
new InDM[MAX_PLAYERS];
new Dead[MAX_PLAYERS];

#define     COLOR_GREEN         0x33AA33AA
#define     COLOR_WHITE         0xFFFFFFFF
#if defined FILTERSCRIPT



public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" DM Arena by xxxSpeedxxx v1.0");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else
#endif

//STOCK
stock GetName(playerid)
{
 new pnameid[24];
 GetPlayerName(playerid,pnameid,24);
 return pnameid;
}

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

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(Dead[playerid] == 1)
    {
    SetPlayerHealth(playerid, 100);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 26, cellmax);
    GivePlayerWeapon(playerid, 28, cellmax);
    GivePlayerWeapon(playerid, 24, cellmax);
    GivePlayerWeapon(playerid, 34, cellmax);
    GivePlayerWeapon(playerid, 16, 20);
    new c = random(3);
    if (c == 0){
    SetPlayerPos(playerid, -1128.71, 1057.77, 1346.41);}
    else if (c == 1){
    SetPlayerPos(playerid, -1038.03, 1036.85, 1341.35);}
    else if (c == 2){
    SetPlayerPos(playerid, -971.10, 1061.41, 1345.02);}
    SetPlayerInterior(playerid, 10);
    SetPlayerVirtualWorld(playerid, 1);
    SetPlayerTeam(playerid, playerid);
    SetPlayerSkin(playerid, 167);
    Dead[playerid] = 0;
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(InDM[playerid] == 1)
    {
    new msg[120], msg2[120];
    format(msg, sizeof(msg), "Ubijen si %s!", GetName(playerid));
    format(msg2, sizeof(msg2),"Ubio te %s!", GetName(killerid));
    SendClientMessage(playerid, COLOR_GREEN, msg2);
    SendClientMessage(killerid, COLOR_GREEN, msg);
    SetPlayerHealth(killerid, 100);
    SetPlayerSkin(playerid, 167);
    Dead[playerid] = 1;
    SpawnPlayer(playerid);
    new c = random(3);
    if (c == 0){
    SetPlayerPos(playerid, -1128.71, 1057.77, 1346.41);}
    else if (c == 1){
    SetPlayerPos(playerid, -1038.03, 1036.85, 1341.35);}
    else if (c == 2){
    SetPlayerPos(playerid, -971.10, 1061.41, 1345.02);}
    SetPlayerInterior(playerid, 10);
    SetPlayerVirtualWorld(playerid, 1);
    SetPlayerTeam(playerid, playerid);
    GivePlayerWeapon(playerid, 26, cellmax);
    GivePlayerWeapon(playerid, 16, 20);
    GivePlayerWeapon(playerid, 28, cellmax);
    GivePlayerWeapon(playerid, 24, cellmax);
    GivePlayerWeapon(playerid, 34, cellmax);
    }
    return 1;
}

CMD:napustidm(playerid, params[])
{
    if(InDM[playerid] == 0)
    {
    SendClientMessage(playerid, -1, "Nisi u DM areni!");
    return 1;
    }
    else if(InDM[playerid] == 1)
    {
    InDM[playerid] = 0;
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerHealth(playerid, 0.00);
    SetPlayerInterior(playerid, 0);
    SendClientMessage(playerid, -1, "Napustio si DM arenu!!");
    return 1;
    }
    return 1;
}

CMD:dmarena(playerid, params[])
{
    if(InDM[playerid] == 1) return SendClientMessage(playerid, -1, "Error: Ti si vec u DM areni!"); // Check back if his in the DM arena!
    InDM[playerid] = 1; // we declared him in the DM arena.
    GameTextForPlayer(playerid, "/napustidm da izades iz DM arene!", 3000, 4); // a little game text to tell him how to exit if he's bored from the arena.
    SendClientMessage(playerid, -1, "{66FF66}Dobrodosao u DM arenu! {BABABA}"); // Welcoming him to the arena..
    new c = random(3);
    if (c == 0){
    SetPlayerPos(playerid, -1128.71, 1057.77, 1346.41);}
    else if (c == 1){
    SetPlayerPos(playerid, -1038.03, 1036.85, 1341.35);}
    else if (c == 2){
    SetPlayerPos(playerid, -971.10, 1061.41, 1345.02);}
    SetPlayerInterior(playerid, 10);
    SetPlayerVirtualWorld(playerid, 1);
    SetPlayerTeam(playerid, playerid); // setting every player in a team, since every one has a unique playerid
    ResetPlayerWeapons(playerid); // removing his weapons from outside the arena
    SetPlayerColor(playerid, COLOR_WHITE); // setting everyone's color to white, u can change it
    SetPlayerSkin(playerid, 167); // setting his funny skin
    SetPlayerHealth(playerid, 100); // 100 for the health
    GivePlayerWeapon(playerid, 26, cellmax);
    GivePlayerWeapon(playerid, 28, cellmax);
    GivePlayerWeapon(playerid, 24, cellmax);
    GivePlayerWeapon(playerid, 34, cellmax);
    GivePlayerWeapon(playerid, 16, 20); // we gave him the weapons here.

    new str[200], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(str, sizeof(str), "{FFFFFF}%s {BABABA}(ID: %d) se teleportirao u DM arenu! Pridruzi mu se koristeci /dmarena !", name, playerid);
    SendClientMessageToAll(-1, str);// we just announced to everyone that he entered the arena
    return 1;
}
Reply
#2

Take a look at https://sampwiki.blast.hk/wiki/SetPlayerWantedLevel
Reply
#3

Okay that,but the /napustidm(leavedm) cmd how to make it leave without killing the player?
Reply
#4

PHP код:
CMD:napustidm(playeridparams[])
{
    if(
InDM[playerid] == 0)
    {
    
SendClientMessage(playerid, -1"Nisi u DM areni!");
    return 
1;
    }
    else if(
InDM[playerid] == 1)
    {
    
InDM[playerid] = 0;
    
SetPlayerVirtualWorld(playerid0);
    
SetPlayerInterior(playerid0);
    
SpawnPlayer(playerid);
    
SendClientMessage(playerid, -1"Napustio si DM arenu!!");
    return 
1;
    }
    return 
1;

spawn the player on using this command by: SpawnPlayer(playerid);
Reply
#5

Can you Explain i dont understand what you talking about Wanted level..

But

Код:
CMD:napustidm(playerid, params[])
{
    if(InDM[playerid] == 0)
    {
    SendClientMessage(playerid, -1, "Nisi u DM areni!");
    return 1;
    }
    else if(InDM[playerid] == 1)
    { 
    InDM[playerid] = 0;
    SetPlayerVirtualWorld(playerid, 0); 
    SetPlayerInterior(playerid, 0);
    SpawnPlayer(playerid);
    SendClientMessage(playerid, -1, "Napustio si DM arenu!!");
    return 1;
    }
    return 1;
}
Just spawn him when he leave dm but this can abuse suppose player do try this cmd 2 time and spawn him self to avoid death so its better to kill him rather than doing that.

And i dont see in this code any wanted level function it maybe from your gamemode.
Reply
#6

About wl,I wanted When a player kills another player in the DM arena to not give him a wanted level.
Reply
#7

i don't see any thing setting player wanted over there maybe you setting player wanted other place?
Reply
#8

In this script where are no giving any wanted level maybe wanted level is giving from your gamemode script check that under OnPlayerDeath
Reply
#9

Yes,its from my gamemode,never mind i fixed the problem,Thanks!
Reply
#10

I found a bug,When i kill myself with a granade I's buged like with my /kill CMD.Ports into the DM arena cordinates,but in the wrong world and interior? What should I do??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)