DM arena command
#1

How to make when a player types /dmarena that he cannot type it againt if he is already in the arena?

PHP код:
CMD:dmarena(playeridparams[])
{
    
InDM[playerid] = 1// we declared him in the DM arena.
    
GameTextForPlayer(playerid"/napustidm da izades iz DM arene!"30004); // 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 random(3);
    if (
== 0){
    
SetPlayerPos(playerid, -1128.711057.771346.41);}
    else if (
== 1){
    
SetPlayerPos(playerid, -1038.031036.851341.35);}
    else if (
== 2){
    
SetPlayerPos(playerid, -971.101061.411345.02);}
    
SetPlayerInterior(playerid10);
    
SetPlayerVirtualWorld(playerid1);
    
SetPlayerTeam(playeridplayerid); // setting every player in a team, since every one has a unique playerid
    
ResetPlayerWeapons(playerid); // removing his weapons from outside the arena
    
SetPlayerColor(playeridCOLOR_WHITE); // setting everyone's color to white, u can change it
    
SetPlayerSkin(playerid167); // setting his funny skin
    
SetPlayerHealth(playerid100); // 100 for the health
    
SetPlayerArmour(playerid100); // 100 armour
    
GivePlayerWeapon(playerid26cellmax);
    
GivePlayerWeapon(playerid28cellmax);
    
GivePlayerWeapon(playerid24cellmax);
    
GivePlayerWeapon(playerid34cellmax);
    
GivePlayerWeapon(playerid162); // we gave him the weapons here.
    
new str[200], name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    
format(strsizeof(str), "{FFFFFF}%s {BABABA}(ID: %d) se teleportirao u DM arenu! Pridruzi mu se koristeci /dmarena !"nameplayerid);
    
SendClientMessageToAll(-1str);// we just announced to everyone that he entered the arena
    
return 1;
}
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);
    
SetPlayerHealth(playerid0.00);
    
ForceClassSelection(playerid);
    
SetPlayerInterior(playerid0);
    
SendClientMessage(playerid, -1"Napustio si DM arenu!!");
    return 
1;
    }
    return 
1;

Reply
#2

PHP код:
CMD:dmarena(playeridparams[]) 

    if(
InDM[playerid] == 1) return SendClientMessage(playerid, -1"Error: You are already in the DM Arena"); // 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!"30004); // 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 random(3); 
    if (
== 0){ 
    
SetPlayerPos(playerid, -1128.711057.771346.41);} 
    else if (
== 1){ 
    
SetPlayerPos(playerid, -1038.031036.851341.35);} 
    else if (
== 2){ 
    
SetPlayerPos(playerid, -971.101061.411345.02);} 
    
SetPlayerInterior(playerid10); 
    
SetPlayerVirtualWorld(playerid1); 
    
SetPlayerTeam(playeridplayerid); // setting every player in a team, since every one has a unique playerid 
    
ResetPlayerWeapons(playerid); // removing his weapons from outside the arena 
    
SetPlayerColor(playeridCOLOR_WHITE); // setting everyone's color to white, u can change it 
    
SetPlayerSkin(playerid167); // setting his funny skin 
    
SetPlayerHealth(playerid100); // 100 for the health 
    
SetPlayerArmour(playerid100); // 100 armour 
    
GivePlayerWeapon(playerid26cellmax); 
    
GivePlayerWeapon(playerid28cellmax); 
    
GivePlayerWeapon(playerid24cellmax); 
    
GivePlayerWeapon(playerid34cellmax); 
    
GivePlayerWeapon(playerid162); // we gave him the weapons here. 

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

Try this.
Reply
#3

Thanks works excelent
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)