new InDM[MAX_PLAYERS];
new Dead[MAX_PLAYERS];
#define COLOR_GREEN 0x33AA33AA
#define COLOR_WHITE 0xFFFFFFFF
//OnPlayerConnect
InDM[playerid] = 0;
if(Dead[playerid] == 1)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 26, cellmax);
GivePlayerWeapon(playerid, 28, cellmax);
GivePlayerWeapon(playerid, 24, cellmax);
GivePlayerWeapon(playerid, 34, cellmax);
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377);
SetPlayerVirtualWorld(playerid, 1);
SetPlayerSkin(playerid, 167);
Dead[playerid] = 0;
}
SetPlayerHealth(playerid, 100); // we set the player's health and armour to 100 OnPlayerSpawn
SetPlayerArmour(playerid, 100);
ResetPlayerWeapons(playerid); // we resetted the player's weapons
GivePlayerWeapon(playerid, 26, cellmax); // we gave the player the following weapons:2 grenades, Desert eagle, sniper, UZI and sawn off.
GivePlayerWeapon(playerid, 28, cellmax); // you can change it to what you want of course.
GivePlayerWeapon(playerid, 24, cellmax); // cellmax is to give the player infinite ammo.
GivePlayerWeapon(playerid, 34, cellmax);
GivePlayerWeapon(playerid, 16, 2);
SetPlayerInterior(playerid, 1); // setting his interior to 1(Check Interiors list to see which one we have set to the DM arena
SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377); // coordinates for his player spawn
SetPlayerVirtualWorld(playerid, 1); // Virtual world 1, doesn't matter anyway
SetPlayerSkin(playerid, 167); // chicken head skin, just for fun :D
Dead[playerid] = 0; // As we've declared before Dead == 1, now it sets it to 0.
if(InDM[playerid] == 1)
// now the code
new msg[120], msg2[120];
format(msg, sizeof(msg), "You killed %s!", GetName(playerid));
format(msg2, sizeof(msg2),"You got killed by %s!", GetName(killerid));
SendClientMessage(playerid, COLOR_GREEN, msg2);
SendClientMessage(killerid, COLOR_GREEN, msg);
SetPlayerHealth(killerid, 100);
SetPlayerArmour(killerid, 100);
SetPlayerSkin(playerid, 167);
Dead[playerid] = 1;
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377);
SetPlayerVirtualWorld(playerid, 1);
SetPlayerTeam(playerid, playerid);
GivePlayerWeapon(playerid, 26, cellmax);
GivePlayerWeapon(playerid, 16, 2);
GivePlayerWeapon(playerid, 28, cellmax);
GivePlayerWeapon(playerid, 24, cellmax);
GivePlayerWeapon(playerid, 34, cellmax);
CMD:exitdm(playerid, params[])
{
if(InDM[playerid] == 0)
{
SendClientMessage(playerid, -1, "You are not at the DM arena!");
return 1;
}
else if(InDM[playerid] == 1)
{
InDM[playerid] = 0;
SetPlayerVirtualWorld(playerid, 0);
SetPlayerHealth(playerid, 0.00);
ForceClassSelection(playerid);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, -1, "You have left the DM arena!");
return 1;
}
return 1;
}
CMD:enterdm(playerid, params[])
{
InDM[playerid] = 1; // we declared him in the DM arena.
GameTextForPlayer(playerid, "/exitdm to exit!", 3000, 4); // a little game text to tell him how to exit if he's bored from the arena.
SendClientMessage(playerid, -1, "{66FF66}Welcome to the deathmatch arena! {BABABA}"); // Welcoming him to the arena..
SetPlayerInterior(playerid, 1); // setting his interior to 1
SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377); // aswell as his position
SetPlayerVirtualWorld(playerid, 1); // and virtual world :D
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
SetPlayerArmour(playerid, 100); // 100 armour
GivePlayerWeapon(playerid, 26, cellmax);
GivePlayerWeapon(playerid, 28, cellmax);
GivePlayerWeapon(playerid, 24, cellmax);
GivePlayerWeapon(playerid, 34, cellmax);
GivePlayerWeapon(playerid, 16, 2); // 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) has entered the DM arena! Join him using /enterdm !", name, playerid);
SendClientMessageToAll(-1, str);// we just announced to everyone that he entered the arena
return 1;
}
stock GetName(playerid)
{
new pnameid[24];
GetPlayerName(playerid,pnameid,24);
return pnameid;
}
C:\Users\Speed\Desktop\DM ARENA.pwn(69) : error 017: undefined symbol "InDM" C:\Users\Speed\Desktop\DM ARENA.pwn(69) : warning 215: expression has no effect C:\Users\Speed\Desktop\DM ARENA.pwn(69) : error 001: expected token: ";", but found "]" C:\Users\Speed\Desktop\DM ARENA.pwn(69) : error 029: invalid expression, assumed zero C:\Users\Speed\Desktop\DM ARENA.pwn(69) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
Nice tutorial,but i get this error
Code:
C:\Users\Speed\Desktop\DM ARENA.pwn(69) : error 017: undefined symbol "InDM" C:\Users\Speed\Desktop\DM ARENA.pwn(69) : warning 215: expression has no effect C:\Users\Speed\Desktop\DM ARENA.pwn(69) : error 001: expected token: ";", but found "]" C:\Users\Speed\Desktop\DM ARENA.pwn(69) : error 029: invalid expression, assumed zero C:\Users\Speed\Desktop\DM ARENA.pwn(69) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
new InDM[MAX_PLAYERS];