Armour Help. - 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: Armour Help. (
/showthread.php?tid=425309)
Armour Help. -
ZizPower7610 - 25.03.2013
When the armour health is 0 it will spawn back. I don`t know what is going on.
Код:
}
if(listitem == 17)
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid,0xFF0000AA, "ERROR: You don't have enough money to buy this weapon!");
SetPlayerArmour(playerid, 100);
GivePlayerMoney(playerid,-5000);
}
}
Re: Armour Help. -
LeeXian99 - 25.03.2013
pawn Код:
SetPlayerArmour(playerid, 100.0); //Add .0 after whole number, it's a float.
GivePlayerMoney(playerid, -5000); //Must be at the same position with SetPlayerArmour
Re: Armour Help. -
ZizPower7610 - 25.03.2013
Quote:
Originally Posted by LeeXian99
pawn Код:
SetPlayerArmour(playerid, 100.0); //Add .0 after whole number, it's a float. GivePlayerMoney(playerid, -5000); //Must be at the same position with SetPlayerArmour
|
ITs was 100.0 that`s why I tried to change it but still it breaks and comes back again.
Re: Armour Help. -
LeeXian99 - 25.03.2013
pawn Код:
}
if(listitem == 17)
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid,0xFF0000AA, "ERROR: You don't have enough money to buy this weapon!");
SetPlayerArmour(playerid, 100);
GivePlayerMoney(playerid,-5000);
}
}
I don't know if you added ".0" after the whole number, but I fixed GivePlayerMoney for you, try to add .0 and restart your test server. If it's like that, I have no idea then.
Re: Armour Help. -
ZizPower7610 - 25.03.2013
Quote:
Originally Posted by LeeXian99
pawn Код:
} if(listitem == 17) { if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid,0xFF0000AA, "ERROR: You don't have enough money to buy this weapon!"); SetPlayerArmour(playerid, 100); GivePlayerMoney(playerid,-5000); }
}
I don't know if you added ".0" after the whole number, but I fixed GivePlayerMoney for you, try to add .0 and restart your test server. If it's like that, I have no idea then.
|
Ok man Thank`s Can you help me with this code too?
Код:
GameTextForPlayer(playerid, "~n~~n~~n~~n~~r~No Deathmatching!", 100000, 3);
I want "No Deathmatching" To stay there and doesn`t fade away.
Re: Armour Help. -
Dzines4SAMP - 25.03.2013
Quote:
Originally Posted by ZizPower7610
Ok man Thank`s Can you help me with this code too?
Код:
GameTextForPlayer(playerid, "~n~~n~~n~~n~~r~No Deathmatching!", 100000, 3);
I want "No Deathmatching" To stay there and doesn`t fade away.
|
Set the timer to so much seconds to prevent it from fading away
Re: Armour Help. -
ZizPower7610 - 25.03.2013
Quote:
Originally Posted by Dzines4SAMP
Set the timer to so much seconds to prevent it from fading away
|
Thank you All!
Re: Armour Help. -
LeeXian99 - 25.03.2013
pawn Код:
GameTextForPlayer(playerid, "~n~~n~~n~~n~~r~No Deathmatching!", 10000000000000000, 3);
1000ms = 1s
There, unlimited time. :X