[pomoc]/veh

Započeo FireMan, April 27, 2011, 14:31:48 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim:Ravens RP
Detaljan opis problema:Kad namjestim da /veh moze spawnat pAdmin i pTester samo pTester ima ovlasti da ga spawna a admin nema
Dio skripte: if(strcmp(cmd, "/veh", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pTester] < 2)
{
    SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < -1 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
if(car == 520) Hydras ++;
if(car == 425) Hunters ++;
if(car == 430) Predators ++;
if(car == 432) Rhinos ++;
new color2;
color2 = strval(tmp);
if(color2 < -1 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);

new Float:Angle;
GetPlayerFacingAngle(playerid, Angle);

new carid = CreateVehicle(car, X,Y,Z, Angle, color1, color2, 60000);
createdcar[carid] = carid;
engineOn[carid] = true;
LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, carid, 0);
format(string, sizeof(string), "** Vehicle %d spawned.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
new housename[24]; GetVehicleName(carid, housename, sizeof(housename));
new area[36]; GetPlayer2DZone(playerid, area, sizeof(area));
format(string,sizeof(string), "[ADMIN]: %s Has Spawned a %s (%d) [%d] At His Position (%s).",sendername,housename,car,carid,area);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Spawned a %s (%d) [%d] (Color 1: %d | Color 2: %d) At His Position.",d,m,y,h,mi,s,sendername,housename,car,carid,color1,color2);
AdminLog(string);
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):

probaj vako

if(strcmp(cmd, "/veh", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pAdmin] > 1 || PlayerInfo[playerid][pTester] > 2)
{
    SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < -1 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
if(car == 520) Hydras ++;
if(car == 425) Hunters ++;
if(car == 430) Predators ++;
if(car == 432) Rhinos ++;
new color2;
color2 = strval(tmp);
if(color2 < -1 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);

new Float:Angle;
GetPlayerFacingAngle(playerid, Angle);

new carid = CreateVehicle(car, X,Y,Z, Angle, color1, color2, 60000);
createdcar[carid] = carid;
engineOn[carid] = true;
LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, carid, 0);
format(string, sizeof(string), "** Vehicle %d spawned.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
new housename[24]; GetVehicleName(carid, housename, sizeof(housename));
new area[36]; GetPlayer2DZone(playerid, area, sizeof(area));
format(string,sizeof(string), "[ADMIN]: %s Has Spawned a %s (%d) [%d] At His Position (%s).",sendername,housename,car,carid,area);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Spawned a %s (%d) [%d] (Color 1: %d | Color 2: %d) At His Position.",d,m,y,h,mi,s,sendername,housename,car,carid,color1,color2);
AdminLog(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 √

Ne radi >:(

Kako napravis taj Kod (c)
Poslednja Izmena: April 27, 2011, 14:39:59 POSLE PODNE od Dave

To pravis ovako
[ code=c ][ /code ]


samo ovaj razmak sto sma pravio i na pocetku i na kraju izbrises
Poslednja Izmena: April 27, 2011, 14:50:12 POSLE PODNE od matematicar

Citat: matematicar poslato April 27, 2011, 14:46:10 POSLE PODNE
[quote author=Dave link=topic=24011.msg174949#msg174949 date=1303907943]
Ne radi >:(

Kako napravis taj Kod (c)
[/quote]

Uzmes standarni COde tag [ code=c ][ /code ]

samo dodam u prvi ovako =c

izbrisi razmak

Evo ovako je kod mene komande /veh
[code=c] if(strcmp(cmd, "/veh", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
       if (PlayerInfo[playerid][pAdmin] < 6)
{
   SendClientMessage(playerid, COLOR_GRAD1, "   Nisi u mogucnosti koristiti ovu komandu!");
   return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /veh [carid] [color1] [color2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Vozila nemogu ici ispod 400 ili iznad 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /veh [carid] [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < -1 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Boja nemoze biti ispod 0 ili iznad 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /veh [carid] [color1] [color2]");
return 1;
}
if(car == 520) Hydras ++;
if(car == 425) Hunters ++;
if(car == 430) Predators ++;
if(car == 432) Rhinos ++;
new color2;
color2 = strval(tmp);
if(color2 < -1 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Boja nemoze biti ispod 0 ili iznad 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y+5,Z+1, 0.0, color1, color2, 60000);
LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
format(string, sizeof(string), "** Vozilo %d spawnano.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
new housename[24]; GetVehicleName(carid, housename, sizeof(housename));
new area[24]; GetPlayer2DZone(playerid, area, sizeof(area));
format(string,sizeof(string), "[ADMIN]: %s je spawnao %s (%d) [%d] na svojoj poziciji (%s).",sendername,housename,car,carid,area);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Spawned a %s (%d) [%d] (Color 1: %d | Color 2: %d) At His Position.",d,m,y,h,mi,s,sendername,housename,car,carid,color1,color2);
AdminLog(string);
}
return 1;
}

[/code]

Znam da je tako ali ja zelim da moze pAdmin i pTester a kad stavim pAdmin i pTester samo pTester moze a neznam zasto

taj kod stavis ovako [ code = c ] text tvoj [ /code ] samo sve spojeno ofc

ON:neznam zast ti nece :/
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 √


if(strcmp(cmd, "/veh", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 2)
{
    SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < -1 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
if(car == 520) Hydras ++;
if(car == 425) Hunters ++;
if(car == 430) Predators ++;
if(car == 432) Rhinos ++;
new color2;
color2 = strval(tmp);
if(color2 < -1 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);

new Float:Angle;
GetPlayerFacingAngle(playerid, Angle);

new carid = CreateVehicle(car, X,Y,Z, Angle, color1, color2, 60000);
createdcar[carid] = carid;
engineOn[carid] = true;
LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, carid, 0);
format(string, sizeof(string), "** Vehicle %d spawned.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
new housename[24]; GetVehicleName(carid, housename, sizeof(housename));
new area[36]; GetPlayer2DZone(playerid, area, sizeof(area));
format(string,sizeof(string), "[ADMIN]: %s Has Spawned a %s (%d) [%d] At His Position (%s).",sendername,housename,car,carid,area);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Spawned a %s (%d) [%d] (Color 1: %d | Color 2: %d) At His Position.",d,m,y,h,mi,s,sendername,housename,car,carid,color1,color2);
AdminLog(string);
}
return 1;
}

Citat: eXtreme poslato April 27, 2011, 15:09:24 POSLE PODNE

if(strcmp(cmd, "/veh", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 2)
{
    SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < -1 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
if(car == 520) Hydras ++;
if(car == 425) Hunters ++;
if(car == 430) Predators ++;
if(car == 432) Rhinos ++;
new color2;
color2 = strval(tmp);
if(color2 < -1 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);

new Float:Angle;
GetPlayerFacingAngle(playerid, Angle);

new carid = CreateVehicle(car, X,Y,Z, Angle, color1, color2, 60000);
createdcar[carid] = carid;
engineOn[carid] = true;
LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, carid, 0);
format(string, sizeof(string), "** Vehicle %d spawned.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
new housename[24]; GetVehicleName(carid, housename, sizeof(housename));
new area[36]; GetPlayer2DZone(playerid, area, sizeof(area));
format(string,sizeof(string), "[ADMIN]: %s Has Spawned a %s (%d) [%d] At His Position (%s).",sendername,housename,car,carid,area);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Spawned a %s (%d) [%d] (Color 1: %d | Color 2: %d) At His Position.",d,m,y,h,mi,s,sendername,housename,car,carid,color1,color2);
AdminLog(string);
}
return 1;
}


Opet nece


if(strcmp(cmd, "/veh", true) == 0) 
   { 
       if(IsPlayerConnected(playerid)) 
       { 
          if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 2) 
         {   
         tmp = strtok(cmdtext, idx); 
         if(!strlen(tmp)) 
         { 
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]"); 
            return 1; 
         } 
         new car; 
         car = strval(tmp); 
         if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Vehicle Number can't be below 400 or above 611 !"); return 1; } 
         tmp = strtok(cmdtext, idx); 
         if(!strlen(tmp)) 
         { 
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]"); 
            return 1; 
         } 
         new color1; 
         color1 = strval(tmp); 
         if(color1 < -1 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; } 
         tmp = strtok(cmdtext, idx); 
         if(!strlen(tmp)) 
         { 
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]"); 
            return 1; 
         } 
         if(car == 520) Hydras ++; 
         if(car == 425) Hunters ++; 
         if(car == 430) Predators ++; 
         if(car == 432) Rhinos ++; 
         new color2; 
         color2 = strval(tmp); 
         if(color2 < -1 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; } 
         new Float:X,Float:Y,Float:Z; 
         GetPlayerPos(playerid, X,Y,Z); 
 
         new Float:Angle; 
         GetPlayerFacingAngle(playerid, Angle); 
 
         new carid = CreateVehicle(car, X,Y,Z, Angle, color1, color2, 60000); 
         createdcar[carid] = carid; 
         engineOn[carid] = true; 
         LinkVehicleToInterior(carid, GetPlayerInterior(playerid)); 
         SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid)); 
         PutPlayerInVehicle(playerid, carid, 0); 
         format(string, sizeof(string), "** Vehicle %d spawned.", carid); 
         SendClientMessage(playerid, COLOR_GREY, string); 
         new housename[24]; GetVehicleName(carid, housename, sizeof(housename)); 
         new area[36]; GetPlayer2DZone(playerid, area, sizeof(area)); 
         format(string,sizeof(string), "[ADMIN]: %s Has Spawned a %s (%d) [%d] At His Position (%s).",sendername,housename,car,carid,area); 
         ABroadCast(COLOR_LIGHTRED, string, 5); 
         new y, m, d; 
         new h,mi,s; 
         getdate(y,m,d); 
         gettime(h,mi,s); 
         format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Spawned a %s (%d) [%d] (Color 1: %d | Color 2: %d) At His Position.",d,m,y,h,mi,s,sendername,housename,car,carid,color1,color2); 
         AdminLog(string); 
      }
      return SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
      }
      return 1; 
   }

Radi samo mi uvjek pise you are not autoriset to use this command i da kako da stavim da mi spawna aute samo iznad 60 jer kad spawna ispod 60 onda su Owner:National Guard
Hvala

Neradim dosta sa strcmp vec sa ZCMD 100 puta lakse,preglednije...Sto se tice Owner:National Guard ID-ovi auta su ti pomesani i trebao bi sve da obrises i da stavis ispocetka (Zato mrzim GF i GF Edite)...