Pawno help needed
#1

guys i have made a dm the cmd to enter dm is /dm..... in my game mode i have 5 teams and a team Mercenary...the specialty of Mercenary is that in Mercenary team members can fight each other all i need is to set player team to Mercenary when they type /dm how to do ......
Reply
#2

please help me i am a noob scripter
Reply
#3

pawn Код:
new gTeam [MAX_PLAYERS];

CMD:dm(playerid, params)
{
    // SetPlayerPos(playerid, Posx, Posy, Posz); if u want to Teleport the player to a Stadium, Posx, Posy, Posz= Co-ords of the place, u mast change it
    gTeam[playerid] = Mercenary;
    // SendClientMessage(playerid, -1, "You Have Entered DM"); message
    return 1;
}
1. u pasted this in an wrong section
2.my code may or may not be right
3.i used ZCMD
4. uncomment it if u want.
Reply
#4

bro its not working
Reply
#5

Quote:
Originally Posted by ragu1987
Посмотреть сообщение
bro its not working
post your /dm command here.
Reply
#6

COMMAND:dm(playerid, params[])
{
dmarena[playerid] = 1;
//Random Spawns
new rand = random(sizeof(DMRandomSpawns));
SetPlayerPos(playerid, DMRandomSpawns[rand][0], DMRandomSpawns[rand][1], DMRandomSpawns[rand][2]);
SetPlayerSkin(playerid, 230);

ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 9, 99999999);
GivePlayerWeapon(playerid, 24, 99999999);
GivePlayerWeapon(playerid, 32, 99999999);
GivePlayerWeapon(playerid, 26, 99999999);
GivePlayerWeapon(playerid, 31, 99999999);
GivePlayerWeapon(playerid, 34, 99999999);

SendClientMessage(playerid,0xFFFFFFF, "To exit the DM arena use /exitdm");

return 1;
}


COMMAND:exitdm(playerid, params[])
{
dmarena[playerid] = 0;
SetPlayerHealth(playerid, 0);
return 1;
}
Reply
#7

First, do this
pawn Код:
COMMAND:exitdm(playerid,params[])
{
dmarena[playerid] =0;
SetPlayerHealth(playerid,0);
SpawnPlayer(playerid);
return 1;
}
then OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
if(dmarena[playerid] == 1)
{
new rand = random(sizeof(DMRandomSpawns));
SetPlayerPos(playerid, DMRandomSpawns[rand][0], DMRandomSpawns[rand][1], DMRandomSpawns[rand][2]);
SetPlayerSkin(playerid, 230);
else {
dmarena[playerid] =0;
SpawnPlayer(playerid);
}
}
return 1;
}
Hope it works for you
Reply
#8

Quote:
Originally Posted by iFiras
Посмотреть сообщение
First, do this
pawn Код:
COMMAND:exitdm(playerid,params[])
{
dmarena[playerid] =0;
SetPlayerHealth(playerid,0);
SpawnPlayer(playerid);
return 1;
}
then OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
if(dmarena[playerid] == 1)
{
new rand = random(sizeof(DMRandomSpawns));
SetPlayerPos(playerid, DMRandomSpawns[rand][0], DMRandomSpawns[rand][1], DMRandomSpawns[rand][2]);
SetPlayerSkin(playerid, 230);
else {
dmarena[playerid] =0;
SpawnPlayer(playerid);
}
}
return 1;
}
Hope it works for you
i need to set them to team Mercenary how to?
Reply
#9

Found Some solution
1.SetPlayerTeam(playerid, NO_TEAM);

2.SetPlayerTeam (playerid,playerid+6);

both of these work but ...
these two have a bug using this team members can kill each other but alert message (abti team attack message appears what to do" is there any way to disable alert message in dm area alone??

if would be better if someone find a way to set team to Mercenary..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)