Hellósztok.
Nem kérek sokat csak azt hogy ebbe a dm zónába kéne nekem az hogy amikor csatlakozik a dm-zónába akkor elvegyen tőle minden fegyvert és az adott fegyvert adjoda! Jaa és még az lenne hogy ha meg hal a dm zónában akkor ne a spawnra spawnoljon hanem a dm-be! Előreis köszönöm
PAWNO:
// 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: { // Minigun DeathMatch
switch(random(3)) {
case 0: SetPlayerPos(playerid, 0.0, 0.0, 0.0); // még nincs!
case 1: SetPlayerPos(playerid, 0.0, 0.0, 0.0); // még nincs!
case 2: SetPlayerPos(playerid, 0.0, 0.0, 0.0); // még nincs!
}
GivePlayerWeapon(playerid, 38, 99999);
}
case 2: { // Sawnoff DeathMatch
switch(random(4)) {
case 0: SetPlayerPos(playerid, 1383.9225,2184.6799,11.0234);
case 1: SetPlayerPos(playerid, 1304.4677,2197.4270,11.0234);
case 2: SetPlayerPos(playerid, 1305.9528,2108.9202,11.0156);
case 3: SetPlayerPos(playerid, 1389.7382,2105.9490,11.0156);
}
GivePlayerWeapon(playerid, 26, 99999);
}
}
}
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, 0.0, 0.0, 0.0); // még nincs!
case 1: SetPlayerPos(playerid, 0.0, 0.0, 0.0); // még nincs!
case 2: SetPlayerPos(playerid, 0.0, 0.0, 0.0); // még nincs!
}
string[0] = EOS;
format(string, sizeof(string), \"{0091ff}%s csatlakozott a {ff0000}Minigun DeathMatch-hoz! Bent vannak:{0091ff} %i\", Name(playerid), dmplayers[0]);
SendClientMessageToAll(-1, string);
}
if(listitem == 1) {
dmplayers[1] ++;
vmi[playerid] = 2;
switch(random(4)) {
case 0: SetPlayerPos(playerid, 1383.9225,2184.6799,11.0234); //
case 1: SetPlayerPos(playerid, 1304.4677,2197.4270,11.0234); //
case 2: SetPlayerPos(playerid, 1305.9528,2108.9202,11.0156); //
case 3: SetPlayerPos(playerid, 1389.7382,2105.9490,11.0156); //
}
string[0] = EOS;
format(string, sizeof(string), \"{0091ff}%s csatlakozott a {ff0000}Sawnoff DeathMatch-hoz! Bent vannak:{0091ff} %i\", Name(playerid), dmplayers[1]);
SendClientMessageToAll(-1, string);
}
SetPVarInt(playerid, \"InDM\", 1);
}
}
return 1;
}
CMD:dm(playerid) {
if(GetPVarInt(playerid, \"InDM\")) return SendClientMessage(playerid, 0xff0000ff, \"{ff0000}Hiba! Te már DM zónában vagy!\");
new line[512];
line[0] = EOS;
format(string, sizeof(string), \"{ff0000}Minigun DeathMatch - {0091ff}Bent tartózkodnak: %i játékos\\n\", dmplayers[0]);
strcat(line, string);
format(string, sizeof(string), \"{ff0000}Sawnoff DeathMatch - {0091ff}Bent tartózkodnak: %i játékos\\n\", dmplayers[1]);
strcat(line, string);
ShowPlayerDialog(playerid, DIALOG_DMS, 2, \"DeatchMatch zónák:\", line, \"Csatlakoz!\", \"Bezár\");
return 1;
}
CMD:exitdm(playerid) {
new dmname[64];
switch(vmi[playerid]) {
case 1: {
dmplayers[0] --;
dmname = \"Minigun DeathMatch\";
}
case 2: {
dmplayers[1] --;
dmname = \"Sawnoff DeathMatch\";
}
}
vmi[playerid] = 0;
SetPVarInt(playerid, \"InDM\", 0);
SpawnPlayer(playerid);
format(string, sizeof(string), \"%s kilépett a %s zónából!\", Name(playerid), dmname);
SendClientMessageToAll(-1, string);
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[]) {
if( strfind(cmdtext, \"/exitdm\") != 0) {
if(GetPVarInt(playerid, \"InDM\") && strcmp(cmdtext, \"/exitdm\") && vmi[playerid] > 0) {
SendClientMessage(playerid, 0xff9999ff, \"{ff0000}Hiba! DM-ben nem használhatsz parancsokat! {00ff00}Kilépéshez: /exitdm\");
return 0;
}
}
return 1;
}
Name(playerid) {
new n[24];
GetPlayerName(playerid, n, 24);
return n;
}