[Pomoc] Komanda /leavedm


Započeo Dacho, Oktobar 14, 2012, 21:02:09 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:Edit bratovog DM-a
Detaljan opis problema:Da li neko moze da mi da primer kako da napravim komandu da ne moze niti jednu komandu da kuca kada je u toj dm areni,dok ne izadje iz nje komandom /leavedm
Dio skripte:

CMD:islanddm(playerid, params[])
{
	new string[128], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	SetTimerEx("Unfreeze", 2000, 0, "d", playerid);
   	GameTextForPlayer(playerid,"~g~Waiting for the Objects to load",2000,3);
    format(string, sizeof(string), "{FF0000}(/islanddm) {FFFF00}Player {FF0000}%s {FFFF00}has Teleported to {FF0000}Island DeathMatch",pName);
    SendClientMessageToAll(playerid, string);
    new Random = random(sizeof(RandomSpawnIslandDM));
    SetPlayerPos(playerid, RandomSpawnIslandDM[Random][0], RandomSpawnIslandDM[Random][1], RandomSpawnIslandDM[Random][2]);
}
Citat: Marley poslato Jun 16, 2012, 17:11:23 POSLE PODNE
Kurcina  :P

Citat: Dude poslato Jun 16, 2012, 17:14:21 POSLE PODNE
čobane šta je ovo?

Respect for David (Sabljak) A.k.A SABO(T)

Vegas.

U OnPlayerCommandText.
new bool:komand[MAX_PLAYERS];
if(komand[playerid] == 1)
{
SendClientMessage(playerid, -1, "Nemozete sada koristiti komande.");
return 0;
}
I daj /leavedm komandu.

CMD:leavedm(playerid, params[])
{
    new Random = random(sizeof(RandomSpawnLEAVEDM));
    SetPlayerPos(playerid, RandomSpawnLEAVEDM[Random][0], RandomSpawnLEAVEDM[Random][1], RandomSpawnLEAVEDM[Random][2]); // Place the X Y Z of the position where they player will be when they type this command
    SendClientMessage(playerid, COLOR_RED, "You have left the Deathmatch Area");
    return 1;
}


EDIT: Sta ti je ovo  if(komand         dobijam na njemu tag mismatch
Poslednja Izmena: Oktobar 14, 2012, 22:26:36 POSLE PODNE od Dacho
Citat: Marley poslato Jun 16, 2012, 17:11:23 POSLE PODNE
Kurcina  :P

Citat: Dude poslato Jun 16, 2012, 17:14:21 POSLE PODNE
čobane šta je ovo?

Respect for David (Sabljak) A.k.A SABO(T)

dodaj pod p info
pUdmarei


e sad dodaj ovo
forward OnPlayerCommandPerformed(playerid, cmdtext[], success);
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(PlayerInfo[playerid][pUdmarei] == 1) return SCM(playerid, 0xFFFFFF, "Nemozes koristiti nijednu komandu dok si u DM arei");


return 1;
}


i dodaj u komandu tu za port
PlayerInfo[playerid][pUdmarei] = 1;

Vegas.

CMD:leavedm(playerid, params[])
{
   if(komand[playerid] == 1)
   {
   komand[playerid] = 0;
    new Random = random(sizeof(RandomSpawnLEAVEDM));
    SetPlayerPos(playerid, RandomSpawnLEAVEDM[Random][0], RandomSpawnLEAVEDM[Random][1], RandomSpawnLEAVEDM[Random][2]); // Place the X Y Z of the position where they player will be when they type this command
    SendClientMessage(playerid, COLOR_RED, "You have left the Deathmatch Area");
    }
    return 1;
}

Citat: Dacho poslato Oktobar 14, 2012, 22:21:03 POSLE PODNE
CMD:leavedm(playerid, params[])
{
    new Random = random(sizeof(RandomSpawnLEAVEDM));
    SetPlayerPos(playerid, RandomSpawnLEAVEDM[Random][0], RandomSpawnLEAVEDM[Random][1], RandomSpawnLEAVEDM[Random][2]); // Place the X Y Z of the position where they player will be when they type this command
    SendClientMessage(playerid, COLOR_RED, "You have left the Deathmatch Area");
    return 1;
}


EDIT: Sta ti je ovo  if(komand         dobijam na njemu tag mismatch

eno probaj moje samo nsam te bas skonto jel ti oces da dok je u DM da nmz koristit ili kad nije u DM da nemoze koristit ?

Citat: --Lood-- poslato Oktobar 14, 2012, 22:28:50 POSLE PODNE
Citat: Dacho poslato Oktobar 14, 2012, 22:21:03 POSLE PODNE
CMD:leavedm(playerid, params[])
{
    new Random = random(sizeof(RandomSpawnLEAVEDM));
    SetPlayerPos(playerid, RandomSpawnLEAVEDM[Random][0], RandomSpawnLEAVEDM[Random][1], RandomSpawnLEAVEDM[Random][2]); // Place the X Y Z of the position where they player will be when they type this command
    SendClientMessage(playerid, COLOR_RED, "You have left the Deathmatch Area");
    return 1;
}


EDIT: Sta ti je ovo  if(komand         dobijam na njemu tag mismatch

eno probaj moje samo nsam te bas skonto jel ti oces da dok je u DM da nmz koristit ili kad nije u DM da nemoze koristit ?

Znaci ovako treba mi da kada je u DM ne moze koristiti niti jednu komandu osim obicnog chata ,i da proverava ako nije u dm areni da ne moze koristit komandu /leavedm    i to tvoje nemam pInfo
Citat: Marley poslato Jun 16, 2012, 17:11:23 POSLE PODNE
Kurcina  :P

Citat: Dude poslato Jun 16, 2012, 17:14:21 POSLE PODNE
čobane šta je ovo?

Respect for David (Sabljak) A.k.A SABO(T)

EDIT: Moze lock ovo ,sredio sam uz pomoc sa-mp ljudi  ;)
Poslednja Izmena: Oktobar 15, 2012, 19:29:58 POSLE PODNE od Dacho
Citat: Marley poslato Jun 16, 2012, 17:11:23 POSLE PODNE
Kurcina  :P

Citat: Dude poslato Jun 16, 2012, 17:14:21 POSLE PODNE
čobane šta je ovo?

Respect for David (Sabljak) A.k.A SABO(T)