Skripta koju koristim: od 0
Detaljan opis problema: pa vako pravim komandu /prati i izbace mi 3 errora:
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10804) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10804) : warning 215: expression has no effect
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10804) : error 001: expected token: ";", but found "if"
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10807) : error 017: undefined symbol "x"
Dio skripte:
CMD:prati(playerid, params[])
{
new giveplayerid;
if(PlayerInfo[playerid][pLider] >= 8 || PlayerInfo[playerid][pClan] >= 8)
{
else if(sscanf(params,"u", giveplayerid)) return SCM(playerid, BELA,"{FFFFFF}iLife Pomoc |{00C0FF} /prati [ID/Dio imena]");
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid,X,Y,Z);
SetPlayerCheckpoint(giveplayerid, x, y, z, 3.0);
}
else
{
SendClientMessage(playerid, CRVENA, "Niste Hitman!");
}
return 1;
}
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Ovako stavi:
CMD:prati(playerid, params[])
{
new igrac, sstr[128];
if(PlayerInfo[playerid][pLider] != 8 || PlayerInfo[playerid][pClan] != 8) return SCM(playerid, 0xFF0000AA, "Niste hitman!");
else if(sscanf(params, "u", igrac)) return SCM(playerid, -1, "iLife Pomoc | {00C0FF} /prati [ID/DioImena]");
else if(!IsPlayerConnected(igrac)) return SCM(playerid, CRVENA, ">Greska< {ffffff}Pogresan ID");
new Float:x, Float:y, Float:z;
GetPlayerPos(igrac, x, y, z);
SetPlayerCheckpoint(playerid, x, y, z, 3.0);
new ime[MAX_PLAYER_NAME];
GetPlayerName(igrac, ime, sizeof(ime));
format(sstr, sizeof(sstr), "INFO: Sada pratite {ffffff}%s", ime);
SCM(playerid, 0xFFFFFFAA, sstr);
return true;
}
Evo uspio sam napraviti da radi bez ikakvih provjera al kad ubacim provjeru evo errora:
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10830) : error 022: must be lvalue (non-constant)
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10830) : error 022: must be lvalue (non-constant)
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10830) : error 022: must be lvalue (non-constant)
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10830) : fatal error 107: too many error messages on one line
Evo komande:
CMD:prati(playerid, params[])
{
if(PlayerInfo[playerid][pLider] = 9 || PlayerInfo[playerid][pClan] = 9 || PlayerInfo[playerid][pLider] = 8 || PlayerInfo[playerid][pClan] = 8
{
new igrac, sstr[128];
if(sscanf(params, "u", igrac)) return SCM(playerid, -1, "iLife Pomoc | {00C0FF} /prati [ID/DioImena]");
else if(!IsPlayerConnected(igrac)) return SCM(playerid, CRVENA, ">Greska< {ffffff}Pogresan ID");
new Float:x, Float:y, Float:z;
GetPlayerPos(igrac, x, y, z);
SetPlayerCheckpoint(playerid, x, y, z, 3.0);
new ime[MAX_PLAYER_NAME];
GetPlayerName(igrac, ime, sizeof(ime));
format(sstr, sizeof(sstr), "INFO: Sada pratite {ffffff}%s", ime);
SCM(playerid, 0xFFFFFFAA, sstr);
Pratiigraca = SetTimer("Zaprati",5200,1);
}
else
{
format(sstr, sizeof(sstr), "ODBIJENO!Samo clanovi FBI i Hitmana!");
SCM(playerid, RED, sstr);
}
return true;
}
Davide evo ubacim ovi errori o5 izbace :(
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10830) : error 022: must be lvalue (non-constant)
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10830) : error 022: must be lvalue (non-constant)
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10830) : error 022: must be lvalue (non-constant)
C:\Users\User\Desktop\International Life RolePlay\gamemodes\iLife.pwn(10830) : fatal error 107: too many error messages on one line
CMD:prati(playerid, params[])
{
if(PlayerInfo[playerid][pLider] = 9 || PlayerInfo[playerid][pClan] = 9 || PlayerInfo[playerid][pLider] = 8 || PlayerInfo[playerid][pClan] = 8) return SCM(playerid,-1,"odbijeno!");
{// ova linija
new igrac, sstr[128];
if(sscanf(params, "u", igrac)) return SCM(playerid, -1, "iLife Pomoc | {00C0FF} /prati [ID/DioImena]");
else if(!IsPlayerConnected(igrac)) return SCM(playerid, CRVENA, ">Greska< {ffffff}Pogresan ID");
new Float:x, Float:y, Float:z;
GetPlayerPos(igrac, x, y, z);
SetPlayerCheckpoint(playerid, x, y, z, 3.0);
new ime[MAX_PLAYER_NAME];
GetPlayerName(igrac, ime, sizeof(ime));
format(sstr, sizeof(sstr), "INFO: Sada pratite {ffffff}%s", ime);
SCM(playerid, 0xFFFFFFAA, sstr);
Pratiigraca = SetTimer("Zaprati",5200,1);
}
return 1;
}
Al meni treba da samo idevi ovih orga mogu to raditi
tamjer mu je beskoristan ako nema funkciju
new Pratiigraca[MAX_PLAYERS]; // Na Vrh
forward Zaprati(playerid, igrac); // na vrh (ili iznad publica)
public Zaprati(playerid, igrac)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(igrac, x, y, z);
SetPlayerCheckpoint(playerid, x, y, z, 3.0);
return true;
}
komandu ovako:
CMD:prati(playerid, params[])
{
new igrac, sstr[128];
if(PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pClan] == 9 || PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pClan] == 8) return SCM(playerid,-1,"odbijeno!");
if(sscanf(params, "u", igrac)) return SCM(playerid, -1, "iLife Pomoc | {00C0FF} /prati [ID/DioImena]");
if(!IsPlayerConnected(igrac)) return SCM(playerid, CRVENA, ">Greska< {ffffff}Pogresan ID");
new Float:x, Float:y, Float:z;
GetPlayerPos(igrac, x, y, z);
SetPlayerCheckpoint(playerid, x, y, z, 3.0);
new ime[MAX_PLAYER_NAME];
GetPlayerName(igrac, ime, sizeof(ime));
format(sstr, sizeof(sstr), "INFO: Sada pratite {ffffff}%s", ime);
SCM(playerid, 0xFFFFFFAA, sstr);
Pratiigraca[playerid] = SetTimerEx("Zaprati",5200,true, "i", playerid);
return 1;
}
EDIT: stani imas provjere ako je CLAN / LIDER org 9 i 8 da mu odbije, koji ti je ID Hitmana(vecinom 8(GF))
Stavis samo
if(PlayerInfo[playerid][pMember] != 8) // != znaci Ako nije clan org 8 ako me razumijes