Sziasztok!
Valaki át tudná nekem alakítani ezt a ladminos god parancsot úgy hogy bennelegyen a dm scriptembe, és ha belépek a dm-be ki is kapcsoljon a god?
nagyon megköszönném!
god parancs:
dcmd_god(playerid,params[]) {
#pragma unused params
if(PlayerInfo[playerid][Level] >= 0 || IsPlayerAdmin(playerid)) {
if(PlayerInfo[playerid][God] == 0) {
PlayerInfo[playerid][God] = 1;
SetPlayerHealth(playerid,100000);
SendClientMessage(playerid,green,\"{0088ff}[TDc]{ff1e00} You included GOD mode.\");
return CMDMessageToAdmins(playerid,\"GOD\");
} else {
PlayerInfo[playerid][God] = 0;
SendClientMessage(playerid,red,\"{0088ff}[TDc]{ff1e00} You disabled GOD mode.\");
SetPlayerHealth(playerid, 100);
} return GivePlayerWeapon(playerid,35,0);
} else return SendClientMessage(playerid,red,\"HIBA: Ehez a parancshoz legalább 4-es szintű adminnak kéne lenned!\");
}
script:
// DM rendszer script By: Flash ( < sampforum.hu > )
#include a_samp
#include zcmd
#define DIALOG_DMS 1234
new string[512];
new dmplayers[2];
new vmi[MAX_PLAYERS];
public OnPlayerConnect(playerid) { SetPVarInt(playerid, \"InDM\", 0); return 1; }
public OnPlayerDisconnect(playerid, reason) { if(GetPVarInt(playerid, \"InDM\")) cmd_exitdm(playerid); return 1; }
public OnPlayerSpawn(playerid) {
if(GetPVarInt(playerid, \"InDM\")) {
switch(vmi[playerid]) {
case 1: { // Sniper DeathMatch
switch(random(3)) {
case 0: SetPlayerPos(playerid, 2234.4512,-4347.2925,61.6492); // írd át
case 1: SetPlayerPos(playerid, 2295.9045,-4221.7349,68.8954); // írd át
case 2: SetPlayerPos(playerid, 2097.8926,-4351.5107,67.6572); // írd át
}
GivePlayerWeapon(playerid, 34, 120);
}
case 2: { // Sawnoff DeathMatch
switch(random(3)) {
case 0: SetPlayerPos(playerid, -2016.8114,-140.0194,42.0168); // írd át
case 1: SetPlayerPos(playerid, -2078.3311,-187.9200,35.3203); // írd át
case 2: SetPlayerPos(playerid, -2090.1719,-251.4148,35.3203); // írd át
}
GivePlayerWeapon(playerid, 26, 120);
}
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
switch(dialogid) {
case DIALOG_DMS: {
if(!response) return 1;
if(listitem == 0) {
dmplayers[0] ++;
vmi[playerid] = 1;
switch(random(3)) {
case 0: SetPlayerPos(playerid, 2234.4512,-4347.2925,61.6492); // írd át
case 1: SetPlayerPos(playerid, 2295.9045,-4221.7349,68.8954); // írd át
case 2: SetPlayerPos(playerid, 2097.8926,-4351.5107,67.6572); // írd át
}
GivePlayerWeapon(playerid, 34, 120);
string[0] = EOS;
/*format(string, sizeof(string), \"{0088ff}[TDc] {ff1e00}%s {FFFFFF}has joined the Sniper DeathMatch! {0088ff}In Game: {FFFFFF}%i\", Name(playerid), dmplayers[0]);
SendClientMessageToAll(-1, string);*/
SendClientMessage(playerid, 0xffffffAA, \"{0088ff}[TDc] {ff1e00}You joined the Sniper DeathMatch!\");
}
if(listitem == 1) {
dmplayers[1] ++;
vmi[playerid] = 2;
switch(random(3)) {
case 0: SetPlayerPos(playerid, -2016.8114,-140.0194,42.0168); // írd át
case 1: SetPlayerPos(playerid, -2078.3311,-187.9200,35.3203); // írd át
case 2: SetPlayerPos(playerid, -2090.1719,-251.4148,35.3203); // írd át
}
GivePlayerWeapon(playerid, 26, 120);
string[0] = EOS;
/*format(string, sizeof(string), \"{0088ff}[TDc] {ff1e00}%s {FFFFFF}has joined the Sawnoff DeathMatch! {0088ff}In Game: {FFFFFF}%i\", Name(playerid), dmplayers[1]);
SendClientMessageToAll(-1, string);*/
SendClientMessage(playerid, 0xffffffAA, \"{0088ff}[TDc] {ff1e00}You joined the Sawnoff DeathMatch!\");
}
SetPVarInt(playerid, \"InDM\", 1);
}
}
return 1;
}
CMD:dm(playerid) {
if(GetPVarInt(playerid, \"InDM\")) return SendClientMessage(playerid, 0xff0000ff, \"{0088ff}[TDc]{ff0000} Error! You are now in arena!\");
new line[512];
line[0] = EOS;
format(string, sizeof(string), \"Sniper DeathMatch - In Game: %i player\\n\", dmplayers[0]);
strcat(line, string);
format(string, sizeof(string), \"Sawnoff DeathMatch - In Game: %i player\\n\", dmplayers[1]);
strcat(line, string);
ShowPlayerDialog(playerid, DIALOG_DMS, 2, \"DeatchMatch zones:\", line, \"Join!\", \"Close\");
return 1;
}
CMD:exitdm(playerid) {
new dmname[64];
switch(vmi[playerid]) {
case 1: {
dmplayers[0] --;
dmname = \"Sniper DeathMatch\";
}
case 2: {
dmplayers[1] --;
dmname = \"Sawnoff DeathMatch\";
}
}
vmi[playerid] = 0;
SetPVarInt(playerid, \"InDM\", 0);
SpawnPlayer(playerid);
SetPlayerHealth(playerid, 99999);
//format(string, sizeof(string), \"{0088ff}[TDc] %s {FFFFFF}has left the %s zone!\", Name(playerid), dmname);
//SendClientMessageToAll(-1, string);
SendClientMessage(playerid, 0xffffffAA, \"{0088ff}[TDc] {FFFFFF}You left the DM zone!\");
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[]) {
if( strfind(cmdtext, \"/exitdm\") != 0) {
if(GetPVarInt(playerid, \"InDM\") && strcmp(cmdtext, \"/exitdm\") && vmi[playerid] > 0) {
SendClientMessage(playerid, 0xff9999ff, \"{0088ff}[TDc] {ff0000}Error! You can\'t use commands in DM! {FFFFFF}Leave: /exitdm\");
return 0;
}
}
return 1;
}
/*Name(playerid) {
new n[24];
GetPlayerName(playerid, n, 24);
return n;
}*/
Javítottam helyetted a
taget
tagre!