SA-MP Forums Archive
[REPS] Mostwanted = Attach3DTextLabelToPlayer , Create3DTextLabel - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [REPS] Mostwanted = Attach3DTextLabelToPlayer , Create3DTextLabel (/showthread.php?tid=495682)



[REPS] Mostwanted = Attach3DTextLabelToPlayer , Create3DTextLabel - SPA - 18.02.2014

Hello ,im wondering how to attach to player most wanted if he have 6 stars , i tried also at onplayerupdate its make lag because keep seting the text exceds iv this code;
Код:
   	if(strcmp(cmdtext, "/mostwanted", true) == 0)
    {
    new count = 1, name[24];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        GetPlayerWantedLevel(i);
        if(GetPlayerWantedLevel(i) >= 5)
        {
            GetPlayerName(i, name, sizeof(name));
            format(string, sizeof(string), "%s%s (%d) - Wanted Level: %d\n", string, name,i,GetPlayerWantedLevel(i));
            count ++;
        }
    }
    if(count != 1)
    {
        ShowPlayerDialog(playerid, 26, DIALOG_STYLE_MSGBOX, "Most Wanted Players Online", string, "OK", "");
    }
    else ShowPlayerDialog(playerid, 26, DIALOG_STYLE_MSGBOX, "Most Wanted Players Online", "No online wanted players.", "OK", "");
    return 1;
    }



Respuesta: [REPS] Mostwanted = Attach3DTextLabelToPlayer , Create3DTextLabel - OTACON - 18.02.2014

pawn Код:
COMMAND:mostwanted(playerid, params[]){
    new countplayer=0,name[25],data[144],result[144];
    for(new player, user = GetMaxPlayers(); player != user; player++){
        //if(IsPlayerConnected(player) && GetPlayerWantedLevel(player) >= 5){
        if(IsPlayerConnected(player) && GetPlayerWantedLevel(player) == 6){
            countplayer++;
            GetPlayerName(player, name, sizeof(name));
            if(countplayer>0){
                format(data, sizeof(data), "%s(%d) - Wanted Level: %d \n",name,player,GetPlayerWantedLevel(player));
                strcat(result,data);
            }else if(countplayer<=0){
                format(data, sizeof(data), "No online wanted players.");
                strcat(result,data);
            }
        }
    }
    ShowPlayerDialog(playerid, 16, DIALOG_STYLE_MSGBOX, "Most Wanted Players Online", result, "OK", "");
    return true;
}



Re: Respuesta: [REPS] Mostwanted = Attach3DTextLabelToPlayer , Create3DTextLabel - SPA - 18.02.2014

Quote:
Originally Posted by OTACON
Посмотреть сообщение
pawn Код:
COMMAND:mostwanted(playerid, params[]){
    new countplayer=0,name[25],data[144],result[144];
    for(new player, user = GetMaxPlayers(); player != user; player++){
        //if(IsPlayerConnected(player) && GetPlayerWantedLevel(player) >= 5){
        if(IsPlayerConnected(player) && GetPlayerWantedLevel(player) == 6){
            countplayer++;
            GetPlayerName(player, name, sizeof(name));
            if(countplayer>0){
                format(data, sizeof(data), "%s(%d) - Wanted Level: %d \n",name,player,GetPlayerWantedLevel(player));
                strcat(result,data);
            }else if(countplayer<=0){
                format(data, sizeof(data), "No online wanted players.");
                strcat(result,data);
            }
        }
    }
    ShowPlayerDialog(playerid, 16, DIALOG_STYLE_MSGBOX, "Most Wanted Players Online", result, "OK", "");
    return true;
}
I need Text3D that the player most wanted :/


Re: [REPS] Mostwanted = Attach3DTextLabelToPlayer , Create3DTextLabel - SPA - 19.02.2014

Help


Re: [REPS] Mostwanted = Attach3DTextLabelToPlayer , Create3DTextLabel - Bingo - 19.02.2014

3D label above the players head?
*Bubble?


Re: [REPS] Mostwanted = Attach3DTextLabelToPlayer , Create3DTextLabel - SPA - 19.02.2014

Quote:
Originally Posted by [vTc]Patroool
Посмотреть сообщение
3D label above the players head?
*Bubble?
Yeah


Re: [REPS] Mostwanted = Attach3DTextLabelToPlayer , Create3DTextLabel - Vanter - 19.02.2014

I suggest you add it once he robs something that made him 6stars,
pawn Код:
//under the robbery that made him 6stars
    new PlayerText3D:MW3d;
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos( playerid, X, Y, Z );
    MW3d = CreatePlayer3DTextLabel(playerid,"Most Wanted",0xFF0000AA,X,Y,Z,40.0);
    Attach3DTextLabelToPlayer(MW3d, playerid, 0.0, 0.0, 0.7);