This Script Work Or Not? - 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: This Script Work Or Not? (
/showthread.php?tid=397680)
This Script Work Or Not? -
Trollolollo - 06.12.2012
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/godmodez", cmdtext, true, 5) == 0)
{
SetPlayerArmour(playerid, 9999999999999.0);
SetPlayerHealth(playerid, 9999999999999.0);
return 1;
}
return 0;
}
Re: This Script Work Or Not? -
InfiniTy. - 06.12.2012
No.. just put 5000 it will work or this
pawn Код:
#define INFINITY (Float:0x7F800000)
And
pawn Код:
SetPlayerHealth(playerid, INFINITY);
And also delete ,5
So it's like this :
pawn Код:
if (strcmp("/godmodez", cmdtext, true) == 0)
Command :
pawn Код:
#define INFINITY (Float:0x7F800000)
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/godmodez", cmdtext, true) == 0)
{
SetPlayerArmour(playerid, INFINITY);
SetPlayerHealth(playerid, INFINITY);
return 1;
}
return 0;
}
Note : I don't know if it works with the armour too ( the infinity thing ) but you can try.
Re: This Script Work Or Not? -
Trollolollo - 06.12.2012
Oh Ok.How Can I Make It Need To Pay 5000 To Use This Command.
And I Want To Put Dialog 'God Mode CMD By Trollolollo'
Re: This Script Work Or Not? -
InfiniTy. - 06.12.2012
Quote:
Originally Posted by Trollolollo
Oh Ok.How Can I Make It Need To Pay 5000 To Use This Command.
And I Want To Put Dialog 'God Mode CMD By Trollolollo'
|
pawn Код:
#define INFINITY (Float:0x7F800000)
#define DIALOG_MOCMD 32765
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/godmodez", cmdtext, true) == 0)
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid,-1,"You need $5.000 to use this command");
SetPlayerArmour(playerid, INFINITY);
SetPlayerHealth(playerid, INFINITY);
GivePlayerMoney(playerid,-5000);
ShowPlayerDialog(playerid, DIALOG_MOCMD, DIALOG_STYLE_MSGBOX, "Title", "Message", "Button 1", " Button 2");
return 1;
}
return 0;
}
Something like this ?