SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   setarmour issue (https://forum.sa-mp.com/showthread.php?t=444976)

itsCody 19/06/2013 07:00 AM

setarmour issue
 
When you set somebody's armour it calls back as "Blah has set blah's armour to 12435046"
And I can't quite find the issue.

pawn Code:
dcmd_setarmour(playerid, params[])
{
    new id;
    new amount;
    new string[70];
    if(sscanf(params,"uf",id,amount)) return SendClientMessage(playerid,COLOR_ERROR, "Usage: /setarmour [ID] [AMOUNT]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_ERROR,"This player is not connected.");
    else
    {
    SetPlayerArmour(id,amount);
    format(string,sizeof(string),"{FF0000}[ADMIN] {FFFFFF}%s[%d] has set %s[%d]'s armour to %d.",PlayerName(playerid),playerid,PlayerName(id),id,amount);
    SendClientMessageToAll(COLOR_WHITE,string);
    return 1;
    }
}

MP2 19/06/2013 07:13 AM

Re: setarmour issue
 
Armour is a float.

DaTa[X] 19/06/2013 07:33 AM

Re: setarmour issue
 
pawn Code:
dcmd_setarmour(playerid, params[])
{
    new id;
    new Float:amount;
    new string[70];
    if(sscanf(params,"uf",id,amount)) return SendClientMessage(playerid,COLOR_ERROR, "Usage: /setarmour [ID] [AMOUNT]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_ERROR,"This player is not connected.");
    else
    {
    SetPlayerArmour(id,amount);
    format(string,sizeof(string),"{FF0000}[ADMIN] {FFFFFF}%s[%d] has set %s[%d]'s armour to %0.2f.",PlayerName(playerid),playerid,PlayerName(id),id,amount);
    SendClientMessageToAll(COLOR_WHITE,string);
    return 1;
    }
}


All times are GMT. The time now is 09:57 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.