/* Other Includes here */
#include <zcmd>
new IsPlayerInDM[MAX_PLAYERS];
COMMAND:MJDM(playerid, params[])
{
new string[600],pname[MAX_PLAYER_NAME]; //More High string value more message words can be added. pname[MAX_PLAYER_NAME]; will gonna use by GetPlayerName
GetPlayerName(playerid, pname, sizeof(pname)); //We will gonna use pname[MAX_PLAYER_NAME]; here.
if(IsPlayerInDM[playerid] == 1) return SendClientMessage(playerid, MJDM3, "You are already in an deathmatch arena type /leavedm to leave in deathmatch arena"); //Check if player is in dm already if player is in dm the return SendClientMessage will be called
IsPlayerInDM[playerid] = 1; //will set ISPlayerInDM[playerid] to 1
format(string, sizeof(string), "%s has goto MasterJoker's Deathmatch Arena, join with him for fun!", pname); //Format String will be used by SendClientMessageToAll. the pname that we define with GetPlayerName last time is used here if you have low string value in new string the message will be cutoff
SendClientMessageToAll(COLOR_MJDM, string); //Format string above will be sent if you have low string value in new string the message will be cutoff. otherwise this will sent your name saying you enter on MJ's Deathmatch Arena
SendClientMessage(playerid, COLOR_MJDM2, "You join MasterJoker's Deathmatch Arena, have fun"); //When you type the command this message will be sent
SetPlayerPosition(playerid, 0, 0, 0); //Example Only no have time to save pos its 10:30PM here
SetPlayerFacingAngle(playerid, 0); //Example too replace this with your position coordinates.
return 1;
}
CMD:leavedm(playerid, params[])
{
new string[600],pname[MAX_PLAYER_NAME]; //More High string value more message words can be added. pname[MAX_PLAYER_NAME]; will gonna use by GetPlayerName
GetPlayerName(playerid, pname, sizeof(pname)); //We will gonna use pname[MAX_PLAYER_NAME]; here.
if(IsPlayerInDM[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You already leave MJ's DM Arena!"); //Checks if player already left MJDM Arena if he is already the return sendclientmessage will be called
IsPlayerInDM[playerid] = 0; //if the system detect that player are in DM yet the server will set and remove the player in DM
format(string, sizeof(string), "%s has left MasterJoker's Deathmatch Arena, join with him for fun!", pname); //Format String will be used by SendClientMessageToAll. the pname that we define with GetPlayerName last time is used here if you have low string value in new string the message will be cutoff
SendClientMessageToAll(COLOR_MJDM, string); //Format string above will be sent if you have low string value in new string the message will be cutoff. otherwise this will sent your name saying you left on MJ's Deathmatch Arena
SendClientMessage(playerid, COLOR_MJDM2, "You left MasterJoker's Deathmatch Arena, have fun"); //When you type the command this message will be sent
//Your spawnpoint position code here!
return 1;
}
//Credits to sansko because i forgot to add /leavedm he reminds me on it look at comment below
Wow, never use a string size of 600, as maximum that can fit in the screen is 128 !
|
%s has goto MasterJoker's Deathmatch Arena, join with him for fun!
// Max Player Name lenght is 20