[Pomoc] 2 komande u ZCMD

Započeo System32, April 22, 2011, 09:34:26 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Freeroam by Fafu
Detaljan opis problema:Krenuo sam "prevoditi" skriptu u ZCMD, no imam komande u CMD i DCMD, kad prebacim CMD u ZCMD onda dolazu errori zbog tih DCMDi, pa ako bi mi netko mogao napraviti ove 2 komande u ZCMD a ja cu ostale, to bi bio kao neki primjer, molim vas treba mi to!
Dio skripte:
Komanda 1. if (strcmp("/bhj", cmdtext, true, 10) == 0)
{
        new name[24];
        new string[128];
SetPlayerPos(playerid,345.1740,-2444.0945,399.4128);
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), ""COL_RED"%s "COL_BLUE">>/bhj<<", name);
        SendClientMessageToAll(COLOR_GREEN, string);
        Create3DTextLabel("Dobrodošli na Beach Huge Jump",0x21DD00FF,345.3282,-2443.7742,399.4128,10.0, 0);
        return 1;
}

Komanda 2.     dcmd(time, 4, cmdtext);

dcmd_time(playerid, params[]) {
#pragma unused params
new string[256];
    new Hours,Minutes,Seconds,Days,Months,Years;
    gettime(Hours, Minutes, Seconds);
    getdate(Years, Months, Days);
    format(string, sizeof(string), "~g~%d:%d:%d  ~n~%d/%d/%d", Hours,Minutes,Seconds,Days,Months,Years);
    GameTextForPlayer(playerid, string, 5000, 1);
    return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: April 22, 2011, 09:35:47 PRE PODNE od System32
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

Prva komanda:


CMD:bhj(playerid, params[])
{
new name[24];
    new string[128];
    SetPlayerPos(playerid,345.1740,-2444.0945,399.4128);
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), ""COL_RED"%s "COL_BLUE">>/bhj<<", name);
    SendClientMessageToAll(COLOR_GREEN, string);
    Create3DTextLabel("DobrodoÅ¡li na Beach Huge Jump",0x21DD00FF,345.3282,-2443.7742,399.4128,10.0, 0);
    return 1;
}


Druga komanda:


CMD:time(playerid, params[])
{
    new string[256];
    new Hours,Minutes,Seconds,Days,Months,Years;
    gettime(Hours, Minutes, Seconds);
    getdate(Years, Months, Days);
    format(string, sizeof(string), "~g~%d:%d:%d  ~n~%d/%d/%d", Hours,Minutes,Seconds,Days,Months,Years);
    GameTextForPlayer(playerid, string, 5000, 1);
    return 1;
}

Last nick: Paradox

Awesome :D Tnx
Bili mi mogao jos samo ovo, malo je duza
if(!strcmp(cmd, "/solo", true, 10))
{
new name[24];
new string[128];
    new tmp[256];
    tmp = strtok(cmdtext, idx);
    new id = strval(tmp);
    if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /solo [1-2]");
return 1;
}
switch(id)
{
case 1: { SetPlayerPos2(playerid, 2298.1558, 599.8334, 10.8225, 147.3477, cmdtext); SetPlayerWorldBounds(playerid, 2405.3762, 2234.6714, 626.6244, 530.4633); }
case 2: { SetPlayerPos2(playerid, 2644.9541, 1199.3398, 26.9233, 83.4833, cmdtext); SetPlayerWorldBounds(playerid, 2665.3633, 2624.8916, 1234.9679, 1187.0845); }
}
        GivePlayerWeapon(playerid, 26, 8000);
        GivePlayerWeapon(playerid, 29, 8000);
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), ""COL_RED"%s "COL_BLUE">>/solo<<", name);
        SendClientMessageToAll(COLOR_GREEN, string);
return 1;
}
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

poznaticovik

CMD:solo(playerid,params[])
  {  
     new name[24];  
     new string[128];  
      new tmp[256];  
      tmp = strtok(cmdtext, idx);  
      new id = strval(tmp);  
      if(!strlen(tmp))  
     {  
      SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /solo [1-2]");  
      return 1;  
     }  
     switch(id)  
     {  
        case 1: { SetPlayerPos2(playerid, 2298.1558, 599.8334, 10.8225, 147.3477, cmdtext); SetPlayerWorldBounds(playerid, 2405.3762, 2234.6714, 626.6244, 530.4633); }  
        case 2: { SetPlayerPos2(playerid, 2644.9541, 1199.3398, 26.9233, 83.4833, cmdtext); SetPlayerWorldBounds(playerid, 2665.3633, 2624.8916, 1234.9679, 1187.0845); }  
     }  
         GivePlayerWeapon(playerid, 26, 8000);  
         GivePlayerWeapon(playerid, 29, 8000);  
         GetPlayerName(playerid, name, sizeof(name));  
       format(string, sizeof(string), ""COL_RED"%s "COL_BLUE">>/solo<<", name);  
       SendClientMessageToAll(COLOR_GREEN, string);  
     return 1;  
  }
 
Poslednja Izmena: April 22, 2011, 09:56:03 PRE PODNE od [M]att

Matt hvala samo nisi ovo cmdtext prebacio u params ali nema veze ja sam, sad dobijem error zbog ovog idx
error 017: undefined symbol "idx"
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √


CMD:solo(playerid, params[])
{
new name[24];
    new string[128];
    if(!strlen(params))
    {
    SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /solo [1-2]");
        return 1;
    }
    switch(params)
    {
    case 1: { SetPlayerPos2(playerid, 2298.1558, 599.8334, 10.8225, 147.3477, cmdtext); SetPlayerWorldBounds(playerid, 2405.3762, 2234.6714, 626.6244, 530.4633); }
        case 2: { SetPlayerPos2(playerid, 2644.9541, 1199.3398, 26.9233, 83.4833, cmdtext); SetPlayerWorldBounds(playerid, 2665.3633, 2624.8916, 1234.9679, 1187.0845); }
    }
    GivePlayerWeapon(playerid, 26, 8000);
    GivePlayerWeapon(playerid, 29, 8000);
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), ""COL_RED"%s "COL_BLUE">>/solo<<", name);
    SendClientMessageToAll(COLOR_GREEN, string);
    return 1;
}

Last nick: Paradox

Hvala paradox

ali gledaj
(2872) : error 033: array must be indexed (variable "-unknown-")
to ti je 10 linija u ovom sto si ti dao (gornjem postu)
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

Koristiš sscanf?

Last nick: Paradox

naravno
onu 2.verziju
Poslednja Izmena: April 22, 2011, 10:30:27 PRE PODNE od System32
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

Što odmah ne kažeš? :D

Evo ti:


CMD:solo(playerid, params[])
{
new
name[24],
string[128],
id;
   
    if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /solo [1-2]");
    else
    {
    switch(id)
    {
    case 1: { SetPlayerPos2(playerid, 2298.1558, 599.8334, 10.8225, 147.3477, cmdtext); SetPlayerWorldBounds(playerid, 2405.3762, 2234.6714, 626.6244, 530.4633); }
        case 2: { SetPlayerPos2(playerid, 2644.9541, 1199.3398, 26.9233, 83.4833, cmdtext); SetPlayerWorldBounds(playerid, 2665.3633, 2624.8916, 1234.9679, 1187.0845); }
    }
    GivePlayerWeapon(playerid, 26, 8000);
    GivePlayerWeapon(playerid, 29, 8000);
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), ""COL_RED"%s "COL_BLUE">>/solo<<", name);
    SendClientMessageToAll(COLOR_GREEN, string);
}
    return 1;
}

Last nick: Paradox

AHH zaboravio jbg
sad radi,aj kad si vec tu daj i ovu komandu, te duge neznam,ova je zadnja
if(!strcmp(cmd, "/dm", true))
{
new name[24];
new string[128];
    new tmp[256];
    tmp = strtok(cmdtext, idx);
    new id = strval(tmp);
    if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ORANGE, "Koristenje: /dm [1-2]");
return 1;
}
switch(id)
{
case 1: { SetPlayerPos2(playerid, -1404.8365,1486.7024,7.1016,5.1030, cmdtext); SetPlayerWorldBounds(playerid, -1353.5946, -1481.6191, 1508.7335, 1478.5894); }
case 2: { SetPlayerPos2(playerid, -1485.2217,307.2930,53.4609,61.0159, cmdtext); SetPlayerWorldBounds(playerid, -1469.4668, -1573.2063, 360.0035,  281.4446); }
}
        GivePlayerWeapon(playerid, 30, 8000);
        GivePlayerWeapon(playerid, 27, 8000);
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), ""COL_RED"%s "COL_BLUE">>/dm<<", name);
        SendClientMessageToAll(COLOR_GREEN, string);
        Create3DTextLabel("DobrodoÅ¡li na DM",0x21DD00FF,2400.4883,-3100.9282,13.6922,10.0, 0);
return 1;
}

Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

Evo ti:


CMD:dm(playerid, params[])
{
new
name[24],
    string[128],
    id;

    if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_ORANGE, "Koristenje: /dm [1-2]");
    else
    {
      switch(id)
      {
          case 1: { SetPlayerPos2(playerid, -1404.8365,1486.7024,7.1016,5.1030, cmdtext); SetPlayerWorldBounds(playerid, -1353.5946, -1481.6191, 1508.7335, 1478.5894); }
case 2: { SetPlayerPos2(playerid, -1485.2217,307.2930,53.4609,61.0159, cmdtext); SetPlayerWorldBounds(playerid, -1469.4668, -1573.2063, 360.0035,  281.4446); }
}
      GivePlayerWeapon(playerid, 30, 8000);
      GivePlayerWeapon(playerid, 27, 8000);
      GetPlayerName(playerid, name, sizeof(name));
      format(string, sizeof(string), ""COL_RED"%s "COL_BLUE">>/dm<<", name);
      SendClientMessageToAll(COLOR_GREEN, string);
      Create3DTextLabel("DobrodoÅ¡li na DM",0x21DD00FF,2400.4883,-3100.9282,13.6922,10.0, 0);
}
return 1;
}

Last nick: Paradox

Hvala imam jos tih ali to cu sam :D

Mislim dan ema vise problema moze lock


EDIT: Paradox uspio sam napraviti ovu duzu uz tvoj nacin hvala puno!
Poslednja Izmena: April 22, 2011, 10:51:30 PRE PODNE od System32
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √