[Include] New functions [Simple and basic] - 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: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (
https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] New functions [Simple and basic] (
/showthread.php?tid=519235)
New functions [Simple and basic] -
ZKDarkOMG - 13.06.2014
New functions! V1.0
Introduction
New features include a new function brings SAMP, such as X SetPlayerMoney that extablece you money, among other functions.
Functions news
Total aggregate functions 10
More functions are added in future versions.
pawn Код:
SetPlayerMoney(playerid, money);
SetPlayerHealthandArmour(playerid, health, armour);
SetPlayerPosInteriorWorld(playerid, x, y, z, interior, virtualworld);
DesbugPlayer(playerid);
QuitPlayerHealth(playerid, health);
QuitPlayerArmour(playerid, armour);
QuitPlayerHealthandArmour(playerid, health, armour);
GivePlayerHealth(playerid, health);
GivePlayerArmour(playerid, armour);
GivePlayerHealthandArmour(playerid, health, armour);
Are basic functions since they include a basic include
Example
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/desbug", true) == 0)
{
DesbugPlayer(playerid);
return 1;
}
if(strcmp(cmdtext, "/quithealthandarmour", true) == 0)
{
QuitPlayerHealthandArmour(playerid, 53, 23);
return 1;
}
if(strcmp(cmdtext, "/money", true) == 0)
{
if(GetPlayerMoney(playerid) == 20000) return SendClientMessage(playerid, -1, "{ff0000}You can not use this command again to spend the money that we gave you.");
SetPlayerMoney(playerid, 20000);
return 1;
}
return 1;
}
Change log.
Код:
v1.0
- Include create.
v1.1
- Add 3 new functions.
Download
Version 1.0;
Pastebin.
Mediafire.
Version 1.1;
Pastebin.
Mediafire.
Include created by
ZKDarkOMG.
Re: New functions [Simple and basic] -
RajatPawar - 13.06.2014
Didn't read the code but from what I saw..
Re: New functions [Simple and basic] -
iZN - 13.06.2014
This include is totally useless.
Re: New functions [Simple and basic] -
nilanjay - 13.06.2014
What's new about these functions?
Respuesta: New functions [Simple and basic] -
ZKDarkOMG - 13.06.2014
@iZN I did it for newbies, and another thing, you'll be useless.
@nilanjay Read first before commenting, rookie.
Re: Respuesta: New functions [Simple and basic] -
iZN - 13.06.2014
Quote:
Originally Posted by ZKDarkOMG
@iZN another thing, you'll be useless.
|
Makes sense.
Respuesta: New functions [Simple and basic] -
ZKDarkOMG - 13.06.2014
tu mamб
Re: Respuesta: New functions [Simple and basic] -
Vince - 13.06.2014
Quote:
Originally Posted by ZKDarkOMG
I did it for newbies
|
I guess this is the standard excuse now for writing crappy code.
Re: New functions [Simple and basic] -
NewerthRoleplay - 13.06.2014
Did you even test it because I'm fairly sure you aren't meant to upload untested code,
pawn Код:
if(GetPlayerInterior == 0 && GetPlayerVirtualWorld == 0) return SendClientMessage(playerid, -1, "{ff0000}You are not bugged.");
you
need the (playerid) parameter at the end of the functions otherwise it won't work.. Also as ****** said actually document it because just randomly creating something that may or may not be useful just so the spammers can say "Great work +rep", I'm not necessarily saying that was your intention but it does seem to be happening a lot.
And is QuitPlayerArmour supposed to just lower the armour? Because just from the name of the function you can't really see that. The point of the name is to be easily understood, SendClientMessage (Oh we're sending the client a message, makes sense! Not we're qutting the players armour?).
Quote:
Originally Posted by ZKDarkOMG
@iZN I did it for newbies, and another thing, you'll be useless.
@nilanjay Read first before commenting, rookie.
|
Those are some harsh words.
Re: Respuesta: New functions [Simple and basic] -
RajatPawar - 13.06.2014
Quote:
Originally Posted by Vince
I guess this is the standard excuse now for writing crappy code.
|
Haha, I laughed out aloud IRL, that's so true! Thanks for the laugh!