[POMOC]Komanda

Započeo domo101, Januar 10, 2014, 01:14:57 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:Editujem jednu
Detaljan opis problema:Ovako napravio sam da na komandu /tazer pd kad ukuca dobije jedan object u ruci,ali htio bi da taj object imaju samo oni koji su u pd rank 1,2,3,4,a ovi ostali da dobiju onaj pistolj tazer...kako to napraviti??Evo komande
CMD:tazer(playerid, params[])
{
    //#pragma unused help
//#pragma unused params
    if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,"ACS | "CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
if(PlayerInfo[playerid][pClan] != 1 && PlayerInfo[playerid][pLider] != 1) return SendClientMessage(playerid,-1,""PLAVA"[GRESKA] "SIVA"Samo clanovi NYPD!");
if(PolicajacNaDuznosti[playerid] == 0) return SendClientMessage(playerid, -1, ""PLAVA"(NYPD) "SIVA"Niste uzeli znacku(duznost) pa nemozete koristi tu komandu!");
new string[128];
if(Tazer[playerid] == 0)
{
SetPlayerAttachedObject(playerid, 7, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0); //Tazer
format(string, sizeof(string), "* %s uzima tazer.", GetName(playerid));
ProxDetector(30.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
SCM(playerid,-1,""PLAVA"[NYPD] "SIVA"Uzeli ste tazer, da vratite tazer kucajte /tazer!");
Tazer[playerid] = 1;
}
else if(Tazer[playerid] == 1)
{
RemovePlayerAttachedObject(playerid, 7); //Ovo brise tazer
format(string, sizeof(string), "* %s vraca tazer.", GetName(playerid));
ProxDetector(30.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
SCM(playerid,-1,""PLAVA"[NYPD] "SIVA"Vratili ste tazer, da ga ponovo uzmete kucajte /tazer!");
Tazer[playerid] = 0;
}
return 1;
}

switch(rank)
{
    case 1,2,3:
    {
         // sta ce se desit ako je 1,2,3 rank
    }
    default:
    {
        // inace ako je 4,5,6.
    }
}

E a sad mi se poremetila ova komanda ispod te tj. na kraju...evo koje errore mi baca
(35261) : error 014: invalid statement; not in switch
(35261) : error 029: invalid expression, assumed zero
(35283) : error 002: only a single statement (or expression) can follow each "case"
(35283) : error 017: undefined symbol "cmd_najava"
(35283) : error 029: invalid expression, assumed zero

Evo sve:
CMD:tazer(playerid, params[])
{
    //#pragma unused help
//#pragma unused params
    if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,"ACS | "CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
if(PlayerInfo[playerid][pClan] != 1 && PlayerInfo[playerid][pLider] != 1) return SendClientMessage(playerid,-1,""PLAVA"[GRESKA] "SIVA"Samo clanovi NYPD!");
if(PolicajacNaDuznosti[playerid] == 0) return SendClientMessage(playerid, -1, ""PLAVA"(NYPD) "SIVA"Niste uzeli znacku(duznost) pa nemozete koristi tu komandu!");
new string[128];
switch(pRank)
{
case 1,2,3,4:
{
if(Tazer[playerid] == 0)
{
SetPlayerAttachedObject(playerid, 7, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0); //Taser
format(string, sizeof(string), "* %s uzima tazer.", GetName(playerid));
ProxDetector(30.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
SCM(playerid,-1,""PLAVA"[NYPD] "SIVA"Uzeli ste tazer, da vratite tazer kucajte /tazer!");
Tazer[playerid] = 1;
}
else if(Tazer[playerid] == 1)
{
RemovePlayerAttachedObject(playerid, 7); //This remove the taser
format(string, sizeof(string), "* %s vraca tazer.", GetName(playerid));
ProxDetector(30.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
SCM(playerid,-1,""PLAVA"[NYPD] "SIVA"Vratili ste tazer, da ga ponovo uzmete kucajte /tazer!");
Tazer[playerid] = 0;
}
(35261)default:
{
if(Tazer[playerid] == 0)
{
g_GivePlayerWeapon(playerid, 23, 300); //Taser
format(string, sizeof(string), "* %s uzima tazer.", GetName(playerid));
ProxDetector(30.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
SCM(playerid,-1,""PLAVA"[NYPD] "SIVA"Uzeli ste tazer, da vratite tazer kucajte /tazer!");
Tazer[playerid] = 1;
}
else if(Tazer[playerid] == 1)
{
g_GivePlayerWeapon(playerid, 24, 150);
format(string, sizeof(string), "* %s vraca tazer.", GetName(playerid));
ProxDetector(30.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
SCM(playerid,-1,""PLAVA"[NYPD] "SIVA"Vratili ste tazer, da ga ponovo uzmete kucajte /tazer!");
Tazer[playerid] = 0;
    }
return 1;
}
//////////////////////////////////////////////////////////
(35283) CMD:najava(playerid, params[],help)

Nisi lijepo ubacio

Nisi zatvorio zagrade {} kod Case 1,2,3:

ovako ti izgleda

case 1,2,3:
{
    a.a.a.aa.a.a.
    {
        .a.a.aa..a.a
    }
default:


a ovako treba:

case 1,2,3:
{
    a.a.a.aa.a..
    {
         a.a.a.a..a
    }
}