[Pomoc]Warn

Započeo | S-RP | K@lib@r .300, Januar 27, 2012, 21:49:19 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim: CLRP
Detaljan opis problema: 4 Errora
Dio skripte:
        if Index2; tmp1 = strtok(params, Index2), tmp2 = strtok(params, Index2);
Neke slike/video za lakse dobivanje pomoci(neobavezno): C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : error 001: expected token: "*then", but found ";"
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : error 036: empty statement
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : error 012: invalid function call, not a valid address
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Koja carina!
Citat: Fâ,¬nsQ poslato Jun 06, 2012, 15:27:14 POSLE PODNE
mozemi netko reci kada se sper.a dobiva imam 13 i pol godine, a nisam je dobio, moji drugari su to vec dobili, moze pomoc
nov sam pa neznam gdje trebam pitati

"if" nemože završavat sa ";"
i objasni nam ovaj kod...
if Index2; tmp1 = strtok(params, Index2), tmp2 = strtok(params, Index2);
tj. šta ti misliš da si uradio s ovim??

Citat: [RS] K4[Я]!K3â,,¢ poslato Januar 27, 2012, 21:51:46 POSLE PODNE
"if" nemože završavat sa ";"
i objasni nam ovaj kod...
if Index2; tmp1 = strtok(params, Index2), tmp2 = strtok(params, Index2);
tj. šta ti misliš da si uradio s ovim??
Neznam, jer taj Error nemoze nitko popraviti pa sam stavio if. Bio je new
Koja carina!
Citat: Fâ,¬nsQ poslato Jun 06, 2012, 15:27:14 POSLE PODNE
mozemi netko reci kada se sper.a dobiva imam 13 i pol godine, a nisam je dobio, moji drugari su to vec dobili, moze pomoc
nov sam pa neznam gdje trebam pitati

ZahrÄ'o sam Å¡to se tiče strtok-a i ovog...
probaj
new Index2[128]; tmp1 = strtok(params, Index2), tmp2 = strtok(params, Index2);

C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : warning 219: local variable "Index2" shadows a variable at a preceding level
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : error 012: invalid function call, not a valid address
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : warning 215: expression has no effect
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : warning 215: expression has no effect
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : error 001: expected token: ";", but found ")"
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : error 029: invalid expression, assumed zero
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Sada to
Koja carina!
Citat: Fâ,¬nsQ poslato Jun 06, 2012, 15:27:14 POSLE PODNE
mozemi netko reci kada se sper.a dobiva imam 13 i pol godine, a nisam je dobio, moji drugari su to vec dobili, moze pomoc
nov sam pa neznam gdje trebam pitati

Ni ti neznaš kako to izgleda...

tmp1 = strtok(params, Index2);
tmp2 = strtok(params, Index2);


probaj tu liniju zamijenit sa ovom.. ili postaj cijelu komandu!

dcmd_warn(playerid,params[]) {
    if(PlayerInfo[playerid][pAdmin] >= 1) {
        tmp1 = strtok(params, Index2);
        tmp2 = strtok(params, Index2);
        if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /warn [playerid] [reason]");
        new warned = strval(tmp), str[128];
        new sendername[MAX_PLAYER_NAME];
        new giveplayer[MAX_PLAYER_NAME];
    //  if(PlayerInfo[warned][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
if(IsPlayerConnected(warned) && warned != INVALID_PLAYER_ID) {
    if(warned != playerid) {
    ABroadCast(warned,"WARN",1);
PlayerInfo[warned][pWarns]++;
if( PlayerInfo[warned][pWarns] == MAX_WARNINGS) {
GetPlayerName(warned, sendername, sizeof(sendername));
format(str, sizeof (str), "*** \"%s\" je banovan zbog opomena \"%s\".  (Razlog: %s) (Warn: %d/5)***",sendername, params[1+strlen(tmp)], PlayerInfo[warned][pWarns]);
SendClientMessageToAll(COLOR_RED, str);
BanLog(str);
Ban(warned);
return PlayerInfo[warned][pWarns] = 0;
} else {
GetPlayerName(warned, sendername, sizeof(sendername));
GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
format(str, sizeof (str), "***Admin \"%s\" je dao \"%s\" a warn.  (Reason: %s) (Warning: %d/5)***",giveplayer,sendername, params[1+strlen(tmp)], PlayerInfo[warned][pWarns]);
return SendClientMessageToAll(COLOR_YELLOW, str);
}
} else return SendClientMessage(playerid, COLOR_RED, "Classic Life: Ne mozete dati sebi warn");
} else return SendClientMessage(playerid, COLOR_RED, "Classic Life: Igrac nije konektovan");
} else return SendClientMessage(playerid,COLOR_RED,"Classic Life: Niste dovoljan Admin level da koristite tu komandu");
}
Koja carina!
Citat: Fâ,¬nsQ poslato Jun 06, 2012, 15:27:14 POSLE PODNE
mozemi netko reci kada se sper.a dobiva imam 13 i pol godine, a nisam je dobio, moji drugari su to vec dobili, moze pomoc
nov sam pa neznam gdje trebam pitati

pa valjdai ovdje ide tmp1 i tmp2 a ne tmp
if(!strlen(tmp1) || !strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /warn [playerid] [reason]");


i reci koje sad errore imaš? nemogu ja pregledat komandu koja ima 1000+ linija XD

Opet iste Errore
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : error 012: invalid function call, not a valid address
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : warning 215: expression has no effect
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : warning 215: expression has no effect
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : error 001: expected token: ";", but found ")"
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : error 029: invalid expression, assumed zero
C:\Users\Silvio\Desktop\Security RolePlay\gamemodes\SRP.pwn(26611) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

De, ako nemozes popraviti to, mozes ovo?
public ExtortionSBiz(bizid, money)
{
    new string[256];
    format(string, sizeof(string), "Niko");
    if(strcmp(SBizzInfo[bizid][sbExtortion],string, true ) == 0 )
{
    return 0;
}
foreach (Player, i)
{
        new name[MAX_PLAYER_NAME];
new wstring[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s", name);
strmid(wstring, string, 0, strlen(string), 255);
if(strcmp(SBizzInfo[bizid][sbExtortion] ,wstring, true ) == 0 )
{
    new value = money / 100;
    value = value * 10;
    GivePlayerCash(i, value);
    SBizzInfo[bizid][sbTill] -= value;
}
}
return 1;
}

C:\Users\Silvio\Desktop\Security Role Play #1\gamemodes\S.pwn(4042) : error 012: invalid function call, not a valid address
C:\Users\Silvio\Desktop\Security Role Play #1\gamemodes\S.pwn(4042) : warning 215: expression has no effect
C:\Users\Silvio\Desktop\Security Role Play #1\gamemodes\S.pwn(4042) : warning 215: expression has no effect
C:\Users\Silvio\Desktop\Security Role Play #1\gamemodes\S.pwn(4042) : error 001: expected token: ";", but found ")"
C:\Users\Silvio\Desktop\Security Role Play #1\gamemodes\S.pwn(4042) : error 029: invalid expression, assumed zero
C:\Users\Silvio\Desktop\Security Role Play #1\gamemodes\S.pwn(4042) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Red na kojem izmija Error je GivePlayerCash
Koja carina!
Citat: Fâ,¬nsQ poslato Jun 06, 2012, 15:27:14 POSLE PODNE
mozemi netko reci kada se sper.a dobiva imam 13 i pol godine, a nisam je dobio, moji drugari su to vec dobili, moze pomoc
nov sam pa neznam gdje trebam pitati

Sorry za DP, ali hitno mi je. Bilo koje Errore
Koja carina!
Citat: Fâ,¬nsQ poslato Jun 06, 2012, 15:27:14 POSLE PODNE
mozemi netko reci kada se sper.a dobiva imam 13 i pol godine, a nisam je dobio, moji drugari su to vec dobili, moze pomoc
nov sam pa neznam gdje trebam pitati

Lemi_Zero

Izvoli komandu...
dcmd_warn(playerid,params[]) {
    if(PlayerInfo[playerid][pAdmin] >= 1) {
    new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
    if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /warn [playerid] [reason]");
    new warned = strval(tmp), str[128];
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
// if(PlayerInfo[warned][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
if(IsPlayerConnected(warned) && warned != INVALID_PLAYER_ID) {
    if(warned != playerid) {
    ABroadCast(warned,"WARN",1);
PlayerInfo[warned][pWarns]++;
if( PlayerInfo[warned][pWarns] == MAX_WARNINGS) {
GetPlayerName(warned, sendername, sizeof(sendername));
format(str, sizeof (str), "*** \"%s\" je banovan zbog opomena \"%s\".  (Razlog: %s) (Warn: %d/5)***",sendername, params[1+strlen(tmp)], PlayerInfo[warned][pWarns]);
SendClientMessageToAll(COLOR_RED, str);
BanLog(str);
Ban(warned);
return PlayerInfo[warned][pWarns] = 0;
} else {
GetPlayerName(warned, sendername, sizeof(sendername));
GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
format(str, sizeof (str), "***Admin \"%s\" je dao \"%s\" a warn.  (Razlog: %s) (Warning: %d/5)***",giveplayer,sendername, params[1+strlen(tmp)], PlayerInfo[warned][pWarns]);
return SendClientMessageToAll(COLOR_YELLOW, str);
}
} else return SendClientMessage(playerid, COLOR_RED, "DmZ: Ne mozete dati sebi warn");
} else return SendClientMessage(playerid, COLOR_RED, "DmZ: Igrac nije konektovan");
} else return SendClientMessage(playerid,COLOR_RED,"DmZ: Niste dovoljan Admin level da koristite tu komandu");
}

Lock
Koja carina!
Citat: Fâ,¬nsQ poslato Jun 06, 2012, 15:27:14 POSLE PODNE
mozemi netko reci kada se sper.a dobiva imam 13 i pol godine, a nisam je dobio, moji drugari su to vec dobili, moze pomoc
nov sam pa neznam gdje trebam pitati