SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/06/2013, 07:00 AM   #1
itsCody
Gangsta
 
Join Date: Nov 2012
Location: Canada
Posts: 519
Reputation: 45
Default 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;
    }
}
itsCody is offline   Reply With Quote
Old 19/06/2013, 07:13 AM   #2
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,236
Reputation: 1004
Default Re: setarmour issue

Armour is a float.
__________________
Owner and developer of Mike's Cops and Robbers.

Click here to visit our site and find out more. Click here to view trailers.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Old 19/06/2013, 07:33 AM   #3
DaTa[X]
Banned
 
Join Date: Aug 2012
Posts: 371
Reputation: 39
Default 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;
    }
}
DaTa[X] is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unoccupied vehicle sync, boat surfing pausing issue, parachute with vehicle issue, surfing w/ skydiving issue Kar Bug Reports 2 10/06/2013 09:24 AM
[COMPILE ERROR] sethp abd setarmour! NewerthRoleplay Scripting Help 1 02/05/2012 03:09 PM
[help] I HAve An Very Small Issue [not Error] Issue HayZatic Help Archive 1 06/07/2011 04:33 AM
[HElp] /sethealth, /setarmour [Lsgw]LoL Help Archive 1 28/06/2011 12:49 PM
NPC Issue. CrucixTM Help Archive 3 09/10/2010 11:48 AM


All times are GMT. The time now is 11:08 AM.


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