Jump to content

Problema 3dtext wanted


AnoXis

Recommended Posts

Salut, sa-mp.ro, am intercat sa fac sa apara wanted level deasupra numelui, am reusit dar nu imi arata ce wanted level are acel player...

Cod sursa: 

public OnPlayerConnect(playerid)
{
	format(string112, sizeof(string112), "Wanted Level: %d", PlayerInfo[playerid][pWanted]);
	Wanteds[playerid] = Create3DTextLabel(string112, BLUEFAIN, 0, 0, 0, 2.0, 0, 0);
	Attach3DTextLabelToPlayer(Wanteds[playerid], playerid, 0.0, 0.0, 0.7);
    ......

public OnPlayerDisconnect(playerid, reason)
{
    Delete3DTextLabel(Wanteds[playerid]);
	......

Cred ca problema e la linia:

format(string112, sizeof(string112), "Wanted Level: %d", PlayerInfo[playerid][pWanted]);

dar nu sunt sigur ..

Pur si simplu deasupra scrie : Wanted Level: 0  chiar daca el are wanted 2 ..

Edited by AnoXis
Link to comment
Share on other sites

Acum 2 ore, Alberto. a spus:

Arata-mi comanda [/su] sau cum ai tu comanda prin care acorzi wanted jucatorului.

CMD:suspect(playerid, params[])
{
    new giveplayerid, splayer[25], reason[64], wanted;
    if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
    if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "Nu faci parte din Police Department / FBI.");
    if(OnDuty[playerid] == 0)return SendClientMessage(playerid, COLOR_ERROR, "You are not on duty.");
    if(sscanf(params,"s[25]is[64]",splayer,wanted,reason)) return SendClientMessage(playerid, COLOR_SYN, "Sintaxa:{FFFFFF} (/su)spect <Player ID/Name> <wanted> <reason>");
    {
        if(GetPlayers(splayer) == INVALID_PLAYER_ID) return InvalidPlayer(playerid);
        else if(GetPlayers(splayer) == 1000) return ToManyResults(playerid);
        else if(GetPlayers(splayer) == 1001) return ShowResults(playerid, splayer);
        else giveplayerid = GetPlayers(splayer);
        if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_ERROR, "You cannot suspect yourself.");
        if(IsACop(giveplayerid)) return SendClientMessage(playerid, COLOR_ERROR, "You cannot suspect a cop.");
        if(PlayerInfo[giveplayerid][pAJailed] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Acel jucator a fost adus intr-o inchisoare de un administrator, nu il poti suspecta!");
        SetPlayerCriminal(giveplayerid,playerid,reason,wanted);
    }
    return 1;
}

Acum 2 ore, Alberto. a spus:

Arata-mi comanda [/su] sau cum ai tu comanda prin care acorzi wanted jucatorului.

Si daca ai nevoie si de SetPlayerCriminal

	function SetPlayerCriminal(playerid,turner,reason[],wanted)
{
    AddCrime(playerid, reason, wanted);
	    if(PlayerInfo[playerid][pWanted] + wanted < 6)
    {
        PlayerInfo[playerid][pWanted] += wanted;
        Update(playerid, pWantedx);
    }
    else
    {
        PlayerInfo[playerid][pWanted] = 6;
        Update(playerid, pWantedx);
    }
    
    if(turner == 999)
    {
        format(gString, sizeof(gString), "You've commited a crime: %s, Reporter: Unknown. New wanted level: %d",reason, PlayerInfo[playerid][pWanted]);
        SendClientMessage(playerid, COLOR_LIGHTRED2, gString);
	        format(gString, sizeof(gString), "(HQ) %s has commited a crime: %s. Reporter: Unknown. W: +%d. New wanted level: %d", GetName(playerid), reason, wanted, PlayerInfo[playerid][pWanted]);
        SendFactionMessage(1, COLOR_RADIO, gString);
        SendFactionMessage(2, COLOR_RADIO, gString);
    }
    else
    {
        format(gString, sizeof(gString), "You've commited a crime: %s, Reporter: %s. New wanted level: %d",reason,GetName(turner), PlayerInfo[playerid][pWanted]);
        SendClientMessage(playerid, COLOR_DARKNICERED, gString);
	        format(gString, sizeof(gString), "(HQ) %s has commited a crime: %s, Reporter: %s. W: +%d. New wanted level: %d", GetName(playerid), reason, GetName(turner), wanted, PlayerInfo[playerid][pWanted]);
        SendFactionMessage(1, COLOR_RADIO, gString);
        SendFactionMessage(2, COLOR_RADIO, gString);
    }
    
    PlayerInfo[playerid][pWantedLost] = 900;
    Update(playerid, pWantedLostx);
    PlayerTextDrawShow(playerid, WantedTime[playerid]);
    PlayerInfo[playerid][pCrimes] ++;
    Update(playerid, pCrimesx);
    SetPlayerWantedLevel(playerid,PlayerInfo[playerid][pWanted]);
    format(gString, sizeof(gString), "Current Wanted Level: %d", PlayerInfo[playerid][pWanted]);
    SendClientMessage(playerid, COLOR_YELLOW, gString);
    format(gString, sizeof(gString), "Wanted: %d", wanted);
    SetPlayerChatBubble(playerid, gString, COLOR_LIGHTRED, 25.0, 900000);
}

Link to comment
Share on other sites

CMD:suspect(playerid, params[])
{
    new giveplayerid, splayer[25], reason[64], wanted;
    if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
    if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "Nu faci parte din Police Department / FBI.");
    if(OnDuty[playerid] == 0)return SendClientMessage(playerid, COLOR_ERROR, "You are not on duty.");
    if(sscanf(params,"s[25]is[64]",splayer,wanted,reason)) return SendClientMessage(playerid, COLOR_SYN, "Sintaxa:{FFFFFF} (/su)spect <Player ID/Name> <wanted> <reason>");
    {
        if(GetPlayers(splayer) == INVALID_PLAYER_ID) return InvalidPlayer(playerid);
        else if(GetPlayers(splayer) == 1000) return ToManyResults(playerid);
        else if(GetPlayers(splayer) == 1001) return ShowResults(playerid, splayer);
        else giveplayerid = GetPlayers(splayer);
        if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_ERROR, "You cannot suspect yourself.");
        if(IsACop(giveplayerid)) return SendClientMessage(playerid, COLOR_ERROR, "You cannot suspect a cop.");
        if(PlayerInfo[giveplayerid][pAJailed] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Acel jucator a fost adus intr-o inchisoare de un administrator, nu il poti suspecta!");
        SetPlayerCriminal(giveplayerid,playerid,reason,wanted);
        PlayerInfo[giveplayerid][pWanted] = wanted;
        new text[50];
        format(text, sizeof(text)), "Wanted level: %d", wanted);
        Update3DTextLabelText(string112, BLUEFAIN, text);
    }
    return 1;
}
Link to comment
Share on other sites

Acum 2 ore, Alberto. a spus:
CMD:suspect(playerid, params[])
{
    new giveplayerid, splayer[25], reason[64], wanted;
    if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
    if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "Nu faci parte din Police Department / FBI.");
    if(OnDuty[playerid] == 0)return SendClientMessage(playerid, COLOR_ERROR, "You are not on duty.");
    if(sscanf(params,"s[25]is[64]",splayer,wanted,reason)) return SendClientMessage(playerid, COLOR_SYN, "Sintaxa:{FFFFFF} (/su)spect <Player ID/Name> <wanted> <reason>");
    {
        if(GetPlayers(splayer) == INVALID_PLAYER_ID) return InvalidPlayer(playerid);
        else if(GetPlayers(splayer) == 1000) return ToManyResults(playerid);
        else if(GetPlayers(splayer) == 1001) return ShowResults(playerid, splayer);
        else giveplayerid = GetPlayers(splayer);
        if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_ERROR, "You cannot suspect yourself.");
        if(IsACop(giveplayerid)) return SendClientMessage(playerid, COLOR_ERROR, "You cannot suspect a cop.");
        if(PlayerInfo[giveplayerid][pAJailed] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Acel jucator a fost adus intr-o inchisoare de un administrator, nu il poti suspecta!");
        SetPlayerCriminal(giveplayerid,playerid,reason,wanted);
        PlayerInfo[giveplayerid][pWanted] = wanted;
        new text[50];
        format(text, sizeof(text)), "Wanted level: %d", wanted);
        Update3DTextLabelText(string112, BLUEFAIN, text);
    }
    return 1;
}

Nu inteleg ce ai facut tu acolo serios.. mai primesc si warninguri :|

	C:\Users\A\Desktop\Gamemode-uri\gamemode fain\gamemodes\LCH.pwn(21568) : warning 202: number of arguments does not match definition
C:\Users\A\Desktop\Gamemode-uri\gamemode fain\gamemodes\LCH.pwn(21568) : warning 215: expression has no effect
C:\Users\A\Desktop\Gamemode-uri\gamemode fain\gamemodes\LCH.pwn(21568) : warning 215: expression has no effect
C:\Users\A\Desktop\Gamemode-uri\gamemode fain\gamemodes\LCH.pwn(21568) : error 001: expected token: ";", but found ")"
C:\Users\A\Desktop\Gamemode-uri\gamemode fain\gamemodes\LCH.pwn(21568) : error 029: invalid expression, assumed zero
C:\Users\A\Desktop\Gamemode-uri\gamemode fain\gamemodes\LCH.pwn(21568) : warning 215: expression has no effect
C:\Users\A\Desktop\Gamemode-uri\gamemode fain\gamemodes\LCH.pwn(21569) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase
	
3 Errors.
Edited by AnoXis
Link to comment
Share on other sites

Am pus eu o paranteza prost, inlocuieste la linia 'format(text, sizeof(text)), "Wanted level: %d", wanted); si pune asa:

format(text, sizeof(text), "Wanted level: %d", wanted)); 

Si la OnPlayerConnect scrii asa ca sa iti ia variabila corect:

new wanted[MAX_PLAYERS];

wanted[playerid] = GetPlayerWantedLevel(playerid); 

format(string112, sizeof(string112), "Wanted level: %d", wanted[playerid]);

Incearca si spune-mi daca merge, iti explic dupa.

Edited by Alberto.
Link to comment
Share on other sites

Acum 2 ore, Alberto. a spus:

Am pus eu o paranteza prost, inlocuieste la linia 'format(text, sizeof(text)), "Wanted level: %d", wanted); si pune asa:

format(text, sizeof(text), "Wanted level: %d", wanted)); 

Si la OnPlayerConnect scrii asa ca sa iti ia variabila corect:

wanted[playerid] = GetPlayerWantedLevel(playerid); 

format(string112, sizeof(string112), "Wanted level: %d", wanted[playerid]);

Incearca si spune-mi daca merge, iti explic dupa.

in loc de

format(text, sizeof(text), "Wanted level: %d", wanted)); 

era

format(text, sizeof(text), "Wanted level: %d", wanted); 

Iar sintaxa de la 

Update3DTextLabelText(string112, BLUEFAIN, text);

https://wiki.sa-mp.com/wiki/Update3DTextLabelText

pentru ca primesc eroare la ea

C:\Users\A\Desktop\Gamemode-uri\gamemode fain\gamemodes\LCH.pwn(21572) : error 035: argument type mismatch (argument 1) ..

Edited by AnoXis
Link to comment
Share on other sites

Acum 3 minute, AnoXis a spus:

in loc de

format(text, sizeof(text), "Wanted level: %d", wanted)); 

era

format(text, sizeof(text), "Wanted level: %d", wanted); 

Iar sintaxa de la 

Update3DTextLabelText(string112, BLUEFAIN, text);

https://wiki.sa-mp.com/wiki/Update3DTextLabelText

pentru ca primesc eroare la ea

C:\Users\A\Desktop\Gamemode-uri\gamemode fain\gamemodes\LCH.pwn(21572) : error 035: argument type mismatch (argument 1) ..

format(string, sizeof(string),"Wanted: %i",GetPlayerWantedLevel(playerid));

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Acum 2 ore, DaEdRiC-FoX a spus:

format(string, sizeof(string),"Wanted: %i",GetPlayerWantedLevel(playerid));

Am rezolvat, acum imi arata, dar daca ii dau wanted 1 de exemplu ii apare 1 tot merge bine, dar daca ii dau dupa wanted 5 nu apare 6(daca deja are wanted 1), apare wanted 5, cat i-am dat, nu face cu + ..

Link to comment
Share on other sites

Acum 2 ore, AnoXis a spus:

Am rezolvat, acum imi arata, dar daca ii dau wanted 1 de exemplu ii apare 1 tot merge bine, dar daca ii dau dupa wanted 5 nu apare 6(daca deja are wanted 1), apare wanted 5, cat i-am dat, nu face cu + ..

Trebuie adăugate câteva linii de cod în plus, când ajung pe un calculator o sa te ajut.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.