[Include] New functions [Simple and basic]
#1

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.

Reply
#2

Didn't read the code but from what I saw..

Reply
#3

This include is totally useless.
Reply
#4

What's new about these functions?
Reply
#5

@iZN I did it for newbies, and another thing, you'll be useless.

@nilanjay Read first before commenting, rookie.
Reply
#6

Quote:
Originally Posted by ZKDarkOMG
Посмотреть сообщение
@iZN another thing, you'll be useless.
Makes sense.
Reply
#7

tu mamб
Reply
#8

Quote:
Originally Posted by ZKDarkOMG
Посмотреть сообщение
I did it for newbies
I guess this is the standard excuse now for writing crappy code.
Reply
#9

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.
Reply
#10

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)