[Pomoc] Check komanda faila

Započeo ѕєуzιι¢н™.amx, Avgust 05, 2011, 16:36:23 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 4 gostiju pregledaju ovu temu.

Skripta koju koristim: Stari GeForce MOD Edit by Vega
Detaljan opis problema: Kada upisem /check i id igraca prikaze MOJ stats a ne njegov!
Dio skripte: if (strcmp(cmd, "/check", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameMaster] >= 1)
{
   tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DGOLD, "KORISTENJE: /check [playerid/DioImena]");
return 1;
}
//giveplayerid = strval(tmp);
           giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
   if(giveplayerid != INVALID_PLAYER_ID)
   {
ShowStats(playerid,giveplayerid);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Nema toga igraca");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Nisi admin");
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: Avgust 07, 2011, 18:17:29 POSLE PODNE od SeYziicH
Izrada web aplikacija/desktop aplikacija, kontakt PM.
VPS/Dedi managment 'n' hosting @pm also.

Kod (System32) [Izaberi]
ShowStats(playerid,giveplayerid);
to promjeni u
Kod (System32) [Izaberi]
ShowStats(giveplayerid, playerid);

ps. ako ne bude radilo metni funkciju ShowStats ode
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 √

Citat: System32 poslato Avgust 05, 2011, 19:34:21 POSLE PODNE
Kod (System32) [Izaberi]
ShowStats(playerid,giveplayerid);
to promjeni u
Kod (System32) [Izaberi]
ShowStats(giveplayerid, playerid);

Zar ovo neće prikazati statse onom drugom igraču?
Poslednja Izmena: Avgust 06, 2011, 00:58:32 PRE PODNE od mikec

Citat: mikec poslato Avgust 06, 2011, 00:58:22 PRE PODNE
Citat: System32 poslato Avgust 05, 2011, 19:34:21 POSLE PODNE
Kod (System32) [Izaberi]
ShowStats(playerid,giveplayerid);
to promjeni u
Kod (System32) [Izaberi]
ShowStats(giveplayerid, playerid);

Zar ovo neće prikazati statse onom drugom igraču?
neznam funkciju ShowStats pa tako ni to :)
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 √

Citat: mikec poslato Avgust 06, 2011, 00:58:22 PRE PODNE
Citat: System32 poslato Avgust 05, 2011, 19:34:21 POSLE PODNE
Kod (System32) [Izaberi]
ShowStats(playerid,giveplayerid);
to promjeni u
Kod (System32) [Izaberi]
ShowStats(giveplayerid, playerid);

Zar ovo neće prikazati statse onom drugom igraču?

Upravo to i radi evo vam ShowStats:

public ShowStats(playerid,targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
new cash =  GetPlayerMoney(targetid);
new atext[20];
if(PlayerInfo[targetid][pSex] == 1) { atext = "Musko"; }
else if(PlayerInfo[targetid][pSex] == 2) { atext = "Zensko"; }
  new otext[20];
if(PlayerInfo[targetid][pOrigin] == 1) { otext = "Los Santos"; }
else if(PlayerInfo[targetid][pOrigin] == 2) { otext = "San Fierro"; }
else if(PlayerInfo[targetid][pOrigin] == 3) { otext = "Las Venturas"; }
else if(PlayerInfo[targetid][pOrigin] == 4) { otext = "Bone Country"; }
new ttext[30];
if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4) { ttext = "Ballas Gang"; }
else if(gTeam[targetid] == 3 || gTeam[targetid] == 4) { ttext = "Civili"; }
else if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1) { ttext = "Police Department"; }
else if(PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 4) { ttext = "Ballas Gang"; }
else if(PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 5) { ttext = "La Cosa Nostra"; }
else if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 6) { ttext = "Grove Street"; }
else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 8) { ttext = "Hitman Agency"; }
else if(PlayerInfo[targetid][pMember] == 6 || PlayerInfo[targetid][pLeader] == 9) { ttext = "Cable Networks"; }
else if(PlayerInfo[targetid][pMember] == 7 || PlayerInfo[targetid][pLeader] == 10) { ttext = "Yakuza Mafia"; }
new dtext[20];
if(STDPlayer[targetid] == 1) { dtext = "Chlamydia"; }
else if(STDPlayer[targetid] == 2) { dtext = "Gonorrhea"; }
else if(STDPlayer[targetid] == 3) { dtext = "Syphilis"; }
else { dtext = "None"; }
    new ftext[20];
    if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4)
{ ftext = "Firemen/Paramedics"; }
  else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5)
{ ftext = "The Sicilian Mafia"; }
else if(PlayerInfo[targetid][pMember] == 6 || PlayerInfo[targetid][pLeader] == 6)
{ ftext = "GSF"; }
else if(PlayerInfo[targetid][pMember] == 11 || PlayerInfo[targetid][pLeader] == 11)
{ ftext = "License Faction"; }
else
{ ftext = "None"; }
new f2text[20];
    if(PlayerInfo[targetid][pFMember] < 255) { f2text = FamilyInfo[PlayerInfo[targetid][pFMember]][FamilyName]; }
else { f2text = "None"; }
    new rtext[64];
    if(gTeam[targetid] == 5 || PlayerInfo[targetid][pFMember] < 255)//The 2 Organisations
    {
       
}
else if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1)//PD Ranks
{
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Cadet"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Officer"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Corporal"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Sergeant"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Lieutenant"; }
        else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Chief"; }
else { rtext = "Chief"; }
}
else if(PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 2)//FBI Ranks(Org ne postoji IG)
{
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Traine"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Special Agent in Traine"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Agent"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Special Agent"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Assistaint Director in Charge"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Director"; }
else { rtext = "FBI.Agent"; }
}
else if(PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 3)//NG Ranks (Org ne postoji IG)
{
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Private"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Officer"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Sergeant"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Liteutant"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Captain"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "General"; }
else { rtext = "S:W:A:T.Vojnik"; }
}
else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5)//TSM Ranks
{
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Outsider"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Associate"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Soldier"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Capo"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Underboss"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Godfather"; }
else { rtext = "Godfather"; }
}
else if(PlayerInfo[targetid][pMember] == 6 || PlayerInfo[targetid][pLeader] == 6)//GSF Ranks
{
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Busta"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Errand Boy"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Homie"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Gangsta"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Real Gangsta"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "O.G."; }
else { rtext = "O.G."; }
}
else if(PlayerInfo[targetid][pMember] == 8 || PlayerInfo[targetid][pLeader] == 8)//Hitman Ranks
{
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Freelancer"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Marksman"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Agent"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Special Agent"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Vice-Director"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Director"; }
else { rtext = "Director"; }
}
else if(PlayerInfo[targetid][pMember] == 9 || PlayerInfo[targetid][pLeader] == 9)//NR Ranks
{
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Reporter"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "News Reporter"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Network Reporter"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Cable Network Reporter"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Cable Network News Reporter "; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Network Producter"; }
else { rtext = "Netowork Producter"; }
}
else if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4)//Ballas Ranks
{
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Busta"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Errand Boy"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Homie"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Gangsta"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Real Gangsta"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "O.G."; }
else { rtext = "O.G."; }
}
else if(PlayerInfo[targetid][pMember] == 10 || PlayerInfo[targetid][pLeader] == 10)//RM RANKS
{
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Outsider"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Associate"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Soldier"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Capo"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Underboss"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Godfather"; }
else { rtext = "Godfather"; }
}
else if(IsAnInstructor(targetid))//groveeee mafia Ranks(Org ne postoji IG Ne znam ni sta je ...)
{
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Trainee"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Instructor"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Senior Instructor"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Manager"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Underboss"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Boss"; }
else { rtext = "LIC.Ucenik"; }
}
else
{
    rtext = "None";
}
        new jtext[20];
        if(PlayerInfo[targetid][pJob] == 1) { jtext = "Detective"; }
        else if(PlayerInfo[targetid][pJob] == 2) { jtext = "Lawyer"; }
        else if(PlayerInfo[targetid][pJob] == 3) { jtext = "Whore"; }
        else if(PlayerInfo[targetid][pJob] == 4) { jtext = "Drugs Dealer"; }
        else if(PlayerInfo[targetid][pJob] == 5) { jtext = "Car Jackert"; }
        else if(PlayerInfo[targetid][pJob] == 6) { jtext = "TuningRace Club"; }
        else if(PlayerInfo[targetid][pJob] == 7) { jtext = "Car Mechanic"; }
        else if(PlayerInfo[targetid][pJob] == 8) { jtext = "Bodyguard"; }
        else if(PlayerInfo[targetid][pJob] == 9) { jtext = "Arms Dealer"; }
        else if(PlayerInfo[targetid][pJob] == 10) { jtext = "Diler automobilima"; }
else if(PlayerInfo[targetid][pJob] == 12) { jtext = "Boxer"; }
        else if(PlayerInfo[targetid][pJob] == 14) { jtext = "GradonaVozac"; }
        else if(PlayerInfo[targetid][pJob] == 15) { jtext = "Paper Boy"; }
        else if(PlayerInfo[targetid][pJob] == 16) { jtext = "Trucker"; }
else if(PlayerInfo[targetid][pJob] == 17) { jtext = "Donator"; }
else if(PlayerInfo[targetid][pJob] == 18) { jtext = "Postar"; }
        else if(PlayerInfo[targetid][pJob] == 19) { jtext = "Gradjevinar"; }//ovo dujma stavi
        else if(PlayerInfo[targetid][pJob] == 20) { jtext = "Poljoprivrednik"; }//ovo dujma stavi
        else if(PlayerInfo[targetid][pJob] == 21) { jtext = "Svercer materijala"; }//ovo dujma stavi
        else if(PlayerInfo[targetid][pJob] == 22) { jtext = "Taxista"; }//ovo dujma stavi
        else if(PlayerInfo[targetid][pJob] == 23) { jtext = "Vozac taxia"; }//ovo dujma stavi
        else if(PlayerInfo[targetid][pJob] == 24) { jtext = "Lopov";}
        else if(PlayerInfo[targetid][pJob] == 25) { jtext = "Ilegalni farmer"; }//ovo je novo
        else if(PlayerInfo[targetid][pJob] == 26) { jtext = "Svercer droge"; }//ovo je novo
        else if(PlayerInfo[targetid][pJob] == 27) { jtext = "Svercer materijala"; }//ovo dujma stavi
        else { jtext = "None"; }
new drank[20];
if(PlayerInfo[targetid][pDonateRank] == 1) { drank = "Donator"; }
else if(PlayerInfo[targetid][pDonateRank] >= 2) { drank = "Super Donator"; }
else { drank = "None"; }
new married[20];
strmid(married, PlayerInfo[targetid][pMarriedTo], 0, strlen(PlayerInfo[targetid][pMarriedTo]), 255);
        new age = PlayerInfo[targetid][pAge];
new ptime = PlayerInfo[targetid][pConnectTime];
new drugs = PlayerInfo[targetid][pDrugs];
new mats = PlayerInfo[targetid][pMats];
new level = PlayerInfo[targetid][pLevel];
new exp = PlayerInfo[targetid][pExp];
new pnumber = PlayerInfo[targetid][pPnumber];
        new account = PlayerInfo[targetid][pAccount];
new nxtlevel = PlayerInfo[targetid][pLevel]+1;
new expamount = nxtlevel*levelexp;
new costlevel = nxtlevel*levelcost;//10k for testing purposes
new Float:health;
new name[MAX_PLAYER_NAME];
GetPlayerName(targetid, name, sizeof(name));
GetPlayerHealth(targetid,health);
new Float:px,Float:py,Float:pz;
GetPlayerPos(targetid, px, py, pz);
new coordsstring[256];
SendClientMessage(playerid, 0x00FF00FF,"-----------------------------------------[STATISTIKE]-------------------------------------------------------");
format(coordsstring, sizeof(coordsstring), "Level:[%d] Respect:[%d/%d]  Spol:[%s] Novac:[%d] Banka:[$%d] Broj Mobitela:[$%d]", PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pExp],expamount,PlayerInfo[targetid][pSex],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pAccount],PlayerInfo[playerid][pPnumber]);
SendClientMessage(playerid, COLOR_WHITE,coordsstring);
format(coordsstring, sizeof(coordsstring), "Org:[%s] Rank:[%s] Pohvala[%d/5] BEP[%d] Upozorenja[%d] RateKredita:[%d] UhvacenPuta:[%d]", ttext,rtext,PlayerInfo[playerid][pGreats],PlayerInfo[playerid][pBep],ptime,ptime,ptime);
SendClientMessage(playerid, COLOR_WHITE,coordsstring);
format(coordsstring, sizeof(coordsstring), "Posao:[%s] Skill:[%d] MinutaDoPlate[$%d] NadolazecaPlata:[%d] RadnaKnjizica:[%d]", PlayerInfo[playerid][pJob],ptime,ptime,ptime,ptime);
SendClientMessage(playerid, COLOR_WHITE,coordsstring);
format(coordsstring, sizeof(coordsstring), "Cigarete:[%d] Adrenalin:[%d] Droga:[%d] Materijali:[%d] Ubistva:[%d] Smrti:[%d]", ptime, ptime, drugs, mats, PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths]);
SendClientMessage(playerid, COLOR_WHITE,coordsstring);
SendClientMessage(playerid, 0x00FF00FF,"----------------------------------------------------------------------------------------------------------------");
}
}


P.S: Ako vam nebi bio problem kada bi mi pomogli da napravim da taj /check ove crtice budu CRVENE boje da mogu razlikovati bio bi zahvalan!
Izrada web aplikacija/desktop aplikacija, kontakt PM.
VPS/Dedi managment 'n' hosting @pm also.

stvai ovako u komanid ShowStats(playerid, giveplayerid); a u funkciji na pocetku stavis umjesto targetid giveplayerid
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 √

System, ukoliko stavi giveplayerid, glupost ce napravit, onda mora sve targetid-eve mjenjat.. to uopce nema veze zato sto je ovo targetid a ovo giveplayerid, ova funkcija MORA dobro raditi ukoliko je dobro postavljena u komandu ili neki dio skripte.
Aequam memento rebus in arduis servare mentem.

Citat: [GG] LuKsA poslato Avgust 07, 2011, 13:03:06 POSLE PODNE
ova funkcija MORA dobro raditi ukoliko je dobro postavljena u komandu ili neki dio skripte.

Koliko vidiš, dobro je postavljena u komandu. Bar ja nisam uspeo naći grešku.

@SeYziicH, zamolio bih te da opet testiraš komandu .. možda si upisao /check svoj_id

Provjerio sam i pokazuje moje statse znaci ja i frend Mark_Lerws ja napisem /check Mark_Lerws i pokaze meni moje statse napisem /check 2 (to je bio nj id) pokaze opet moje statse meni :S
Izrada web aplikacija/desktop aplikacija, kontakt PM.
VPS/Dedi managment 'n' hosting @pm also.