Korisne komande

Započeo Correlli, Maj 28, 2010, 16:52:57 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 8 gostiju pregledaju ovu temu.

Citat: StjepanS poslato Mart 25, 2013, 13:00:25 POSLE PODNE
YCMD:koordinate(playerid, params[], help)
{
new Float: Pos[3], string[128], int, vw;
if(sscanf(params, "fffii", Pos[0], Pos[1], Pos[2], int, vw)) return SendClientMessage(playerid, -1, "/koordinate [X] [Y] [Z] [INT] [VW]");
SetPlayerPos(playerid, Pos[0],Pos[1],Pos[2]);
SetPlayerInt(playerid, int);
SetPlayerVirutalWorld(playerid, vw);
format(string, sizeof(string), "Portao si se na: X(%.2f), Y(%.2f), Z(%.2f), INT: %i, VW: %i", x, y, z, int, vw);
SendClientMessage(playerid, -1, string);
return 1;
}


Bolje verzija s ycmd i malim izmjenama.  :)
Nije to to, u njegovoj komandi porta i vozilo, i ne koristis nigde parametar help, tako da ti fali #pragma unused help

Vidim da svi radite neke komande evo neke i od mene :)

Ovu su dvije jako korisne komande , znam da ih znate svi ali evo ko ne zna napraviti da mu pomognem.

YCMD:mark(playerid, params[], help)
{
    #pragma unused help
    #pragma unused params
new string[128], Float:xyz[3], into;
if(GetPVarInt(playerid, "Admin") >= 1 || GetPVarInt(playerid, "GameMaster") >= 3)
{
GetPlayerPos(playerid, xyz[0], xyz[1], xyz[2]);
into = GetPlayerInterior(playerid);
SetPVarFloat(playerid, "X", xyz[0]);
SetPVarFloat(playerid, "Y", xyz[1]);
SetPVarFloat(playerid, "Z", xyz[2]);
SetPVarInt(playerid, "Interijer", into);
format(string, sizeof(string), "Port destinacija postavljena! || Koordinate| X: %f || Y: %f || Z: %f || Interijer: %d ", xyz[0], xyz[1], xyz[2], into);
SCM(playerid, GREEN, string);
}
else return SCM(playerid, RED, "{FFFFFF}[{FF2626}GRESKA{FFFFFF}]{1E8FFF} Nisi ovlasten!");
return 1;
}
YCMD:gotomark(playerid, params[], help)
{
    #pragma unused help
    #pragma unused params
if(GetPVarInt(playerid, "Admin") != 0 || GetPVarInt(playerid, "GameMaster") >= 3)
{
if(GetPlayerState(playerid) == 2 && GetPVarInt(playerid, "Interijer") == 0)
{
new vozilo = GetPlayerVehicleID(playerid);
SetVehiclePos(vozilo, GetPVarFloat(playerid, "X"), GetPVarFloat(playerid, "Y"), GetPVarFloat(playerid, "Z"));
}
else
{
SetPlayerPos(playerid, GetPVarFloat(playerid, "X"), GetPVarFloat(playerid, "Y"), GetPVarFloat(playerid, "Z"));
SetPlayerInterior(playerid, GetPVarInt(playerid, "Interijer"));
}
SCM(playerid, ORANGE, "Portan si!");
}
else return SCM(playerid, RED, "{FFFFFF}[{FF2626}GRESKA{FFFFFF}]{1E8FFF} Nisi ovlasten!");
return 1;
}


Evo još dvije korisne komande , to su /a - admin chat i /g gamemaster chat :)

YCMD:a(playerid, params[], help)
{
if(help)
{
    SCM(playerid, ORANGE, "Koristenje /a - chat izmedju administratora!");
}
else
{
new string[128], tekst[128];
if(GetPVarInt(playerid, "Admin") == 0) return SCM(playerid, RED, "{FFFFFF}[{FF2626}GRESKA{FFFFFF}]{1E8FFF} Nisi ovlasten!");
if(!sscanf(params, "s[128]", tekst))
{

format(string, sizeof(string), "A |%d|%s: {419FFF}%s", GetPVarInt(playerid, "Admin"), Imeigraca(playerid), tekst);
SendAdminMessage(0xFF3636FF, string);
}
else return SCM(playerid, ORANGE, "INFO: /a(dmin) [chat]");
}
return 1;
}
YCMD:g(playerid, params[], help)
{
if(help)
{
    SCM(playerid, ORANGE, "Koristenje /g - chat izmedju gamemastera!");
}
else
{
new string[128], tekst[128];
if(GetPVarInt(playerid, "GameMaster") == 0 && GetPVarInt(playerid, "Admin") == 0) return SCM(playerid, RED, "{FFFFFF}[{FF2626}GRESKA{FFFFFF}]{1E8FFF} Nisi ovlasten!");
if(!sscanf(params, "s[128]", tekst))
{
if(GetPVarInt(playerid, "GameMaster") > 0)
format(string, sizeof(string), "GM |%d| %s: {FFFFFF}%s", GetPVarInt(playerid, "GameMaster"), Imeigraca(playerid), tekst);
else if(GetPVarInt(playerid, "Admin") > 0)
format(string, sizeof(string), "A |%d| %s: {FFFFFF}%s", GetPVarInt(playerid, "Admin"), Imeigraca(playerid), tekst);

SendGMMessage(0x51A8D4FF, string);
}
else return SCM(playerid, ORANGE, "INFO: /g(amemaster) [chat]");
}
return 1;
}
Poslednja Izmena: April 05, 2013, 22:52:10 POSLE PODNE od [EG]Fa®kiaS™

zavisi , pvarovi jesu spori, ali ne toliko,za neke stvari su odlicni  :)

Citat: Blaeks poslato April 06, 2013, 10:35:25 PRE PODNE
zavisi , pvarovi jesu spori, ali ne toliko,za neke stvari su odlicni  :)

Za jako mali broj stvari su dobri. ;) Bolje je koristit obične varijable.

Last nick: Paradox

Evo jedne korisne i vrlo jednostavne komande .. Znaci o cemu se radi, da nebi morali da se logirate kao rcon admin pa da kucate /rcon say [OBAVESTENJE] bla bla bla ... To mozete da uradite vrlo jednostavnom komandom /tajni i napisete vas text..... To bi izgledalo ovako !
http://www.dodaj.rs/?23/Rv/4evEsfFe/tajni-chat.png

Evo komanda
if(strcmp(cmd, "/tajni", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Niste se prijavili !");
            return 1;
        }
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1340) if ((noooc) && PlayerInfo[playerid][pGm] < 5)
{
SendClientMessage(playerid, COLOR_GRAD2, "   tajni chat ugasen !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "   Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/tajni) [tajni chat]");
return 1;
}
format(string, sizeof(string), "[OBAVESTENJE] %s " , result);
OOCOff(COLOR_WHITE,string);
printf("%s", string);
}
return 1;
}
Poslednja Izmena: April 07, 2013, 18:18:18 POSLE PODNE od MaaN

Citat: MaaN poslato April 07, 2013, 18:16:41 POSLE PODNE
Evo jedne korisne i vrlo jednostavne komande .. Znaci o cemu se radi, da nebi morali da se logirate kao rcon admin pa da kucate /rcon say [OBAVESTENJE] bla bla bla ... To mozete da uradite vrlo jednostavnom komandom /tajni i napisete vas text..... To bi izgledalo ovako !
http://www.dodaj.rs/?23/Rv/4evEsfFe/tajni-chat.png

Evo komanda
if(strcmp(cmd, "/tajni", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Niste se prijavili !");
            return 1;
        }
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1340) if ((noooc) && PlayerInfo[playerid][pGm] < 5)
{
SendClientMessage(playerid, COLOR_GRAD2, "   tajni chat ugasen !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "   Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/tajni) [tajni chat]");
return 1;
}
format(string, sizeof(string), "[OBAVESTENJE] %s " , result);
OOCOff(COLOR_WHITE,string);
printf("%s", string);
}
return 1;
}

Strcmp :O ?
- Mislim da nisi ti pravio
RESPECT :
Vegas & C++

if(strcmp(cmd, "/tajni", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Niste se prijavili !");
            return 1;
        }
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1340) if ((noooc) && PlayerInfo[playerid][pGm] < 5)
{
SendClientMessage(playerid, COLOR_GRAD2, "   tajni chat ugasen !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "   Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/tajni) [tajni chat]");
return 1;
}
format(string, sizeof(string), "[OBAVESTENJE] %s " , result);
OOCOff(COLOR_WHITE,string);
printf("%s", string);
}
return 1;
}


bolja verzija
YCMD:tajni(playerid, params[], help)
{
#pragma unused help
new string[128];
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "Niste se prijavili!");
if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozete pricati, oduzeto vam je pravo govora!");
if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE,"Koriscenje: /tajni [Tekst]");
format(string,sizeof(string),"%s",params);
SendClientMessageToAll(COLOR_WHITE,string);
return 1;
}

Citat: ...Nikola... poslato April 10, 2013, 18:06:56 POSLE PODNE
if(strcmp(cmd, "/tajni", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Niste se prijavili !");
            return 1;
        }
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1340) if ((noooc) && PlayerInfo[playerid][pGm] < 5)
{
SendClientMessage(playerid, COLOR_GRAD2, "   tajni chat ugasen !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "   Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/tajni) [tajni chat]");
return 1;
}
format(string, sizeof(string), "[OBAVESTENJE] %s " , result);
OOCOff(COLOR_WHITE,string);
printf("%s", string);
}
return 1;
}


bolja verzija
YCMD:tajni(playerid, params[], help)
{
#pragma unused help
new string[128];
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "Niste se prijavili!");
if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozete pricati, oduzeto vam je pravo govora!");
if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE,"Koriscenje: /tajni [Tekst]");
format(string,sizeof(string),"%s",params);
SendClientMessageToAll(COLOR_WHITE,string);
return 1;
}


Bože bogati.. Po čemu je to tajni chat kad se poruka Å¡alje  svima ? hahahahaha

Citat: [SX] TiXoR_ poslato April 10, 2013, 19:05:25 POSLE PODNE
Citat: ...Nikola... poslato April 10, 2013, 18:06:56 POSLE PODNE
if(strcmp(cmd, "/tajni", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Niste se prijavili !");
            return 1;
        }
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1340) if ((noooc) && PlayerInfo[playerid][pGm] < 5)
{
SendClientMessage(playerid, COLOR_GRAD2, "   tajni chat ugasen !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "   Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/tajni) [tajni chat]");
return 1;
}
format(string, sizeof(string), "[OBAVESTENJE] %s " , result);
OOCOff(COLOR_WHITE,string);
printf("%s", string);
}
return 1;
}


bolja verzija
YCMD:tajni(playerid, params[], help)
{
#pragma unused help
new string[128];
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "Niste se prijavili!");
if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozete pricati, oduzeto vam je pravo govora!");
if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE,"Koriscenje: /tajni [Tekst]");
format(string,sizeof(string),"%s",params);
SendClientMessageToAll(COLOR_WHITE,string);
return 1;
}


Bože bogati.. Po čemu je to tajni chat kad se poruka Å¡alje  svima ? hahahahaha

ma ja sam samo kopiro od ovog gore i uradio bolje a to sta me boli kurac cemu sluzi

Evo i ja neku.

Dosta njih trazi za stavljanje lisica pa evo :)




CMD:stavilisice(playerid, params[])
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
new
iPlayerID,
szMessage[40];

if (sscanf(params, "ud", iPlayerID))
return SendClientMessage(playerid, C_WHITE, "KORISTI: /stavilisice(/sl) [igracev ID]");
else if (iPlayerID == INVALID_PLAYER_ID)
return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");
else if (PlayerInfo[iPlayerID][pMember] == PlayerInfo[playerid][pLeader])
return SendClientMessage(playerid, C_WHITE, "ERROR: Nemozete staviti lisice kolegi.");

        TogglePlayerControllable(iPlayerID,0);
        SetPlayerAttachedObject(iPlayerID, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);

        format(szMessage, sizeof(szMessage), COL_RED,"Policajac vam je stavio lisice!");
        SendClientMessage(iPlayerID, C_WHITE, szMessage);
       
        format(szMessage, sizeof(szMessage), COL_RED,"Uspesno ste stavili lisice!");
        SendClientMessage(playerid, C_WHITE, szMessage);
}
return 1;
}


a evo za skidanje

CMD:skinilisice(playerid, params[])
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
    new
        iPlayerID;
if(sscanf(params, "ud", iPlayerID))
            return SendClientMessage(playerid, C_WHITE, "KORISTI: /stavilisice(/sl) [igracev ID]");
        else if (iPlayerID == INVALID_PLAYER_ID)
return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");

        TogglePlayerControllable(iPlayerID,1);
        RemovePlayerAttachedObject(iPlayerID,0);
SetPlayerSpecialAction(iPlayerID,SPECIAL_ACTION_NONE);

}
return 1;
}
Poslednja Izmena: Maj 02, 2013, 18:26:13 POSLE PODNE od ladolez
BIG RESPECT JOEY_
BIG RESPECT [BD] Mr.Gagi

BIG RESPECT David A.k.A Sabljak

Evo jedna moderna admin ooc  komanda xD

CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}


I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
new dstring[256];
format(dstring,sizeof(dstring),"Admin %s kaze: %s",ImeIgraca(playerid),inputtext);
SendClientMessageToAll(-1, dstring);
}
}


ImeIgraca stock:
stock ImeIgraca(playerid)
{
new ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, ime, sizeof(ime));
return ime;
}

Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Poslednja Izmena: Maj 10, 2013, 09:17:53 PRE PODNE od C_PAWN
Mislim dakle Boze
Na Zari sve i svasta

Citat: C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc  komanda xD

CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}


I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
SendClientMessageToAll(-1,"Admin OOC: %s",poruka);
}
}

Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Po meni ova komanda nije ni malo korisna. A imas i gresku tj nisi napravio format jer u SendClinetMessageToAll ne mozes parametre dodavat.
New Vision RPG/DM
Forum: www.nv-samp.com
SA:MP IP: 51.254.86.94 :8221
NV TeamSpeak3: 151.80.174.132:9972


Citat: [SC] - Rıckeη poslato Maj 09, 2013, 23:50:05 POSLE PODNE
Citat: C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc  komanda xD

CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}


I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
SendClientMessageToAll(-1,"Admin OOC: %s",poruka);
}
}

Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Po meni ova komanda nije ni malo korisna. A imas i gresku tj nisi napravio format jer u SendClinetMessageToAll ne mozes parametre dodavat.

Ispravljeno je kao sto sam rekao radio sam preko mobitela

A to sto tebi nije korisno to je tvoje misljenje
Mislim dakle Boze
Na Zari sve i svasta

Citat: [SC] - Rıckeη poslato Maj 09, 2013, 23:50:05 POSLE PODNE
Citat: C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc  komanda xD

CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}


I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
SendClientMessageToAll(-1,"Admin OOC: %s",poruka);
}
}

Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Po meni ova komanda nije ni malo korisna. A imas i gresku tj nisi napravio format jer u SendClinetMessageToAll ne mozes parametre dodavat.
Citat: [WG:RP]C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc  komanda xD

CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}


I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
new dstring[256];
format(dstring,sizeof(dstring),"Admin %s kaze: %s",ImeIgraca(playerid),inputtext);
SendClientMessageToAll(-1, dstring);
}
}


ImeIgraca stock:
stock ImeIgraca(playerid)
{
new ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, ime, sizeof(ime));
return ime;
}

Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Imas tu gresu specifikator
"i" je za brojeve a ne za slova
usput nisi definiso varijablu "poruka"
A takodje mislim da bi dobio warning
u

SendClientMessageToAll(-1,"Admin OOC: %s",poruka);

trebalo bi ici

new poruka[128];
if(sscanf(inputtext, "s[128]", poruka)) return ..
SendClientMessageToAll(-1, poruka);

Citat: --Lood-- poslato Maj 12, 2013, 22:16:06 POSLE PODNE
Citat: [SC] - Rıckeη poslato Maj 09, 2013, 23:50:05 POSLE PODNE
Citat: C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc  komanda xD

CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}




I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
SendClientMessageToAll(-1,"Admin OOC: %s",poruka);
}
}

Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Po meni ova komanda nije ni malo korisna. A imas i gresku tj nisi napravio format jer u SendClinetMessageToAll ne mozes parametre dodavat.
Citat: [WG:RP]C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc  komanda xD

CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}


I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
new dstring[256];
format(dstring,sizeof(dstring),"Admin %s kaze: %s",ImeIgraca(playerid),inputtext);
SendClientMessageToAll(-1, dstring);
}
}


ImeIgraca stock:
stock ImeIgraca(playerid)
{
new ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, ime, sizeof(ime));
return ime;
}

Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Imas tu gresu specifikator
"i" je za brojeve a ne za slova
usput nisi definiso varijablu "poruka"
A takodje mislim da bi dobio warning
u

SendClientMessageToAll(-1,"Admin OOC: %s",poruka);

trebalo bi ici

new poruka[128];
if(sscanf(inputtext, "s[128]", poruka)) return ..
SendClientMessageToAll(-1, poruka);


hvala na ispravci pisao sam preko mobitela pa nezz ni sta sam pisao xD
Mislim dakle Boze
Na Zari sve i svasta