[Pomoc] 2 Warninga

Započeo McEnnedy, Septembar 30, 2011, 14:00:38 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

McEnnedy

Skripta koju koristim: RedLine (Moj Edit)
Detaljan opis problema: 2 Warninga
Dio skripte:
   Create3DTextLabel("Policijski Kompjuter \n [/suspect]",COLOR_ASKQ,222.6239,110.9249,1003.2188);// /suspect
Neke slike/video za lakse dobivanje pomoci(neobavezno):E:\Silvio\Podaci\Server Pordaci - Security RolePlay\Podaci\Game Mod\Exractan Mod\Test Server\RedLine\gamemodes\rcrp.PWN(15576) : warning 202: number of arguments does not match definition
E:\Silvio\Podaci\Server Pordaci - Security RolePlay\Podaci\Game Mod\Exractan Mod\Test Server\RedLine\gamemodes\rcrp.PWN(15576) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.

Moji cijeli kordinati AddPlayerClass(288,222.6239,110.9249,1003.2188,273.5559,0,0,0,0,0,0); //
Poslednja Izmena: Septembar 30, 2011, 14:04:08 POSLE PODNE od McEnnedy



dodaj ovako


Create3DTextLabel("Policijski Kompjuter \n [/suspect]",COLOR_ASKQ,222.6239,110.9249,1003.2188, 40.0, 0);


pa reci dal radi !!

ovo na kraju 40 to ti je daljina na koju se vidi 3dtext
Poslednja Izmena: Septembar 30, 2011, 14:21:06 POSLE PODNE od danijel123
Respect: Gagi, Maki187, Phillips, TerminuS, Neno, Lepotic, [AL] K4[Я]!K3â,,¢, Gotti747

Mora imati ovo:
(text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, virtualworld, testLOS)
tvoje ima: text,color,x,y,z
al nema DrawDistance...
Pogledaj to tamo na onom linku i pokušaj sam napraviti ;)


McEnnedy

Sada radi, ali kada kucam /su neradi wanted level. Mislim nista neuzbacuje. Samo sam napravio da nekome mozes dati wanted level iz PD auta i iz PD postaje
/su CMD:

if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
    if(IsPlayerConnected(playerid))
    if(PlayerToPoint(10.0, playerid,222.6239,110.9249,1003.2188))
    if(PlayerToPoint(10.0, playerid,636.1186,-580.2753,16.0065))
    if(PlayerToPoint(10.0, playerid,636.1263,-567.4291,15.9888))
    if(PlayerToPoint(10.0, playerid,611.5971,-597.3213,16.9719))
    if(PlayerToPoint(10.0, playerid,611.5496,-601.3842,16.9565))
    if(PlayerToPoint(10.0, playerid,611.4792,-605.9762,16.9604))
    {
if(OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 11 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 11) { }
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [opis zlocina]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (gTeam[playerid] == 2 || IsACop(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
if (gTeam[giveplayerid] != 2)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
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: (/su)spect [ID Igraca/Dio Imena] [crime text]");
return 1;
}
if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
else { WantedPoints[giveplayerid]+= 2; }
SetPlayerCriminalEx(giveplayerid,playerid, result);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Ne mozete optuziti policajca !");
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Niste Policajac / FBI / Swat !");
}
}
return 1;

stavio si sve zajedno sa      if(IsPlayerConnected(playerid))  nesme stojati zajedno sa ovim   if(PlayerToPoint(10.0, playerid,222.6239,110.9249,1003.2188)) 

       if(IsPlayerConnected(playerid)) 
       if(PlayerToPoint(10.0, playerid,222.6239,110.9249,1003.2188)) 
       if(PlayerToPoint(10.0, playerid,636.1186,-580.2753,16.0065)) 
       if(PlayerToPoint(10.0, playerid,636.1263,-567.4291,15.9888)) 
       if(PlayerToPoint(10.0, playerid,611.5971,-597.3213,16.9719)) 
       if(PlayerToPoint(10.0, playerid,611.5496,-601.3842,16.9565)) 
       if(PlayerToPoint(10.0, playerid,611.4792,-605.9762,16.9604))
Respect: Gagi, Maki187, Phillips, TerminuS, Neno, Lepotic, [AL] K4[Я]!K3â,,¢, Gotti747

Citat: McEnnedy poslato Septembar 30, 2011, 14:22:40 POSLE PODNE
Sada radi, ali kada kucam /su neradi wanted level. Mislim nista neuzbacuje. Samo sam napravio da nekome mozes dati wanted level iz PD auta i iz PD postaje
/su CMD:

if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
    if(IsPlayerConnected(playerid))
    if(PlayerToPoint(10.0, playerid,222.6239,110.9249,1003.2188)||PlayerToPoint(10.0, playerid,636.1186,-580.2753,16.0065)||PlayerToPoint(10.0, playerid,636.1263,-567.4291,15.9888)||PlayerToPoint(10.0, playerid,611.5971,-597.3213,16.9719)||PlayerToPoint(10.0, playerid,611.5496,-601.3842,16.9565)||PlayerToPoint(10.0, playerid,611.4792,-605.9762,16.9604))
if(OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 11 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 11) { }
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [opis zlocina]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (gTeam[playerid] == 2 || IsACop(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
if (gTeam[giveplayerid] != 2)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
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: (/su)spect [ID Igraca/Dio Imena] [crime text]");
return 1;
}
if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
else { WantedPoints[giveplayerid]+= 2; }
SetPlayerCriminalEx(giveplayerid,playerid, result);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Ne mozete optuziti policajca !");
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Niste Policajac / FBI / Swat !");
}
}
return 1;


probaj ovak

McEnnedy

Sada mi izbija Warning na /swatsu  :'(
if(strcmp(cmd, "/swatsu", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3) { }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [opis zlocina]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (gTeam[playerid] == 2 || IsACop(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
if (gTeam[giveplayerid] != 2)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
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: (/su)spect [ID Igraca/Dio Imena] [crime text]");
return 1;
}
if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
else { WantedPoints[giveplayerid]+= 2; }
SetPlayerCriminalEx(giveplayerid,playerid, result);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Ne mozete optuziti policajca !");
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Niste Policajac / FBI / Swat !");
}
}
return 1;
}

Ne kontam šta će ti /swatsu,stavi sve pod /su :S

McEnnedy

Citat: pHon poslato Septembar 30, 2011, 14:31:10 POSLE PODNE
Ne kontam šta će ti /swatsu,stavi sve pod /su :S
Ne, ja bi da ima i swat /su i PD


McEnnedy

Citat: pHon poslato Septembar 30, 2011, 14:40:09 POSLE PODNE
Koji warning ti izbacuje?
Sada sam to popravio, ali sada izbacuje na cmd /lock
CMD /lock:

if(strcmp(cmd, "/lock", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
new carid;
if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
{
if(gLastCar[playerid] == 0 && PlayerInfo[playerid][pPhousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate vozilo.");
return 1;
}
else if(gLastCar[playerid] != 0 && gLastCar[playerid] != PlayerInfo[playerid][pPhousekey]+1)
{
if (HireCar[playerid] != gLastCar[playerid] && HireCar[playerid] != 299)
{
gLastDriver[HireCar[playerid]] = 300;
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
}
HireCar[playerid] = gLastCar[playerid];
}
}
if (PlayerInfo[playerid][pPhousekey] == 255)
{
if(HireCar[playerid] == 299)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate vozilo.");
return 1;
}
}
carid = PlayerInfo[playerid][pPhousekey]+1;
if(HireCar[playerid] != 299 && !SwitchKey[playerid])
{
carid = HireCar[playerid];
}
//new driver = gLastDriver[carid];
new lockstatus = gCarLock[carid];
new Float:cx,Float:cy,Float:cz;
GetVehiclePos(carid, cx, cy, cz);
switch (lockstatus)
{
case 0:
{
if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate vozilo");
return 1;
}
if(HireCar[playerid] == carid && !SwitchKey[playerid])
{
GameTextForPlayer(playerid, "~w~Iznajmljeni Auto ~r~Je Zakljucan", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 1;
LockCar(carid);
}
else if (PlayerInfo[playerid][pPhousekey] == carid-1)
{
GameTextForPlayer(playerid, "~w~Kucni Auto ~r~Zakljucan", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 1;
LockCar(carid);
return 1;
}
}
case 1:
{
if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate vozilo");
return 1;
}
if(HireCar[playerid] == carid && !SwitchKey[playerid])
{
GameTextForPlayer(playerid, "~w~Iznajmljeni Auto ~g~Je Otkljucan", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 0;
UnLockCar(carid);
}
if (PlayerInfo[playerid][pPhousekey] == carid-1)
{
GameTextForPlayer(playerid, "~w~Kucni Auto ~g~Otkljucan", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 0;
UnLockCar(carid);
return 1;
}
}
default:
{
SendClientMessage(playerid, COLOR_GRAD2, "   Greska");
}
}
if(carid == 256)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate vozilo !");
}
}
return 1;
}

Warning:
E:\Silvio\Podaci\Server Pordaci - Security RolePlay\Podaci\Game Mod\Exractan Mod\Test Server\RedLine\gamemodes\rcrp.PWN(32193) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.

JusT