SA-MP Forums Archive
No Eerror Just BUG [+REP] - 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: No Eerror Just BUG [+REP] (/showthread.php?tid=572659)



No Eerror Just BUG [+REP] - arlindi - 30.04.2015

PHP код:
CMD:client(playeridparams[])
{
    if(
pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playeridCOLOR_GREY"You are not allowed to do this");
        new 
AdminDutyMsg[128], targetid;
        
format(AdminDutyMsgsizeof(AdminDutyMsg), ""COL_WHITE"["COL_CADMIN"ADMIN"COL_WHITE"]"COL_CGREY" %s > client > %s" ,PlayerName(playerid), PlayerName(targetid));
        
SendMessageToAllAduty(-1,AdminDutyMsg);
        new 
ammoweaponidweapon[24], string[128],string1[128],string2[128], id,count;
        if( 
sscanf(params"u"id)) return SendClientMessage(playeridCOLOR_GREY"USAGE: /cw [ID]");
        for (new 
013c++)
        {
                
GetPlayerWeaponData(idcweaponidammo);
                if (
weaponid == && ammo == 0) continue;
                
count++;
        }
        if(
count==0) return SendClientMessage(playeridCOLOR_GREY"This player has no weapons!");
        
format(stringsizeof(string), "Players:%s(%d)\nDatabase ID:%d\nWeapons:",PlayerName(targetid),targetid,pInfo[playerid][ID]);
        for (new 
013c++)
        {
                
GetPlayerWeaponData(idcweaponidammo);
                if (
weaponid == && ammo == 0) continue;
                
GetWeaponName(weaponidweapon24);
                
format(string1sizeof(string1), "%s %s(%d)\n"stringweaponammo);
        }
        
format(string2sizeof(string2), "%s \n VirtualWorld:%d    Interior:%d",string1,GetPlayerVirtualWorld(targetid),GetPlayerInterior(targetid));
        return 
ShowPlayerDialog(playerid,DIALOG_ADMINS,DIALOG_STYLE_MSGBOX,"Viewing Client Info",string2,"Close","");

Hello this is my script
I dont have erors just an little bug
He show mee just 1 Weapon and if i have 2 or 3 or 4
He show mee just the first weapon
I want all weapons
Thank you +REP FOR YOU


Re : No Eerror Just BUG [+REP] - StreetRP - 30.04.2015

Change :
PHP код:
  format(string2sizeof(string2), "%s \n VirtualWorld:%d    Interior:%d",string1,GetPlayerVirtualWorld(targetid),GetPlayerInterior(targetid)); 
By :
PHP код:
  format(string2sizeof(string2), "%s%s \n VirtualWorld:%d    Interior:%d",string2,string1,GetPlayerVirtualWorld(targetid),GetPlayerInterior(targetid)); 



Re: No Eerror Just BUG [+REP] - arlindi - 30.04.2015

Not working Again dont show mee all guns


Re: No Eerror Just BUG [+REP] - trablon - 30.04.2015

Hello buddy, i made an example for you to understand;


pawn Код:
CMD:showplayerguns(playerid,params[])
{
    new id,string[128],ammo[2],name[24];
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /showplayerguns [Player Name/Player ID]");
    for(new w = 0; w < 13; w++)
    {
    GetPlayerWeaponData(id, w, ammo[0], ammo[1]);
    if(ammo[0] == 0) continue;
    GetWeaponName(ammo[0], name, sizeof(name));
    format(string, sizeof(string), "Player's Weapons: %s %s(%d),", string, name, ammo[1]);
    }
    string[strlen(string)-1] = 0;
    SendClientMessage(playerid, -1, string);
    return 1;
}



Re: No Eerror Just BUG [+REP] - arlindi - 30.04.2015

Thank you both fixed
i have another problem
I want to show health 100.00000 Not just 100
Thank you


Re: No Eerror Just BUG [+REP] - icra - 30.04.2015

Can you show me where you check the health?
Can't find it in your script.

Anyway, if you see HP 100 instead of 100.0 means that the variable is integer's type, switch it to Float.

Example:

new FloatlayerHealth;
GetPlayerHealth(playerid,playerHealth);

printf("%f",playerHealth);


Re: No Eerror Just BUG [+REP] - arlindi - 30.04.2015

I am using %d and it show mee 100 but I want it 100.000000


Re: No Eerror Just BUG [+REP] - icra - 30.04.2015

To print float data use %f instead of %d/%i.


Re: No Eerror Just BUG [+REP] - arlindi - 01.05.2015

Not work it tell mee just 100 i want it 100.000000


Re: No Eerror Just BUG [+REP] - Mencent - 01.05.2015

Hello!

PHP код:
new Float:health;
GetPlayerHealth(playerid,health);
printf("%f",float(health)); 
Work this?