[Include] cSelection - Class Selection Textdraws
#1

Creating a good selection is a problem for beginners. Also using GameText will sucks. You can use Textdraws also but making it dynamic is not a good point for newbies.

So i made a one Library. which allows you to create a better Class Selection Informations.

Here is a one showcase picture :


i Think this will be very good for CnR Servers!

So let's use this

We Have these functions*:
pawn Код:
native cS_Show(playerid);
native cS_Hide(playerid);
native cS_Update(playerid, color, teamName[], cInfo[]);
* They aren't native, just for showing in right side of Pawno

Functions

cS_Show(playerid);
@param int playerid The player id to show him the cSelection Textdraws
Example :
pawn Код:
if(!gcSDisplayed[playerid])
    {
        cS_Show(playerid);
    }


cS_Hide(playerid);
@param int playerid The player id to hide for him the cSelection Textdraws
Example :
pawn Код:
if(gcSDisplayed[playerid])
    {
        cS_Hide(playerid);
    }


cS_Update(playerid, color, teamName[], cInfo[]);
@param int playerid The player id to update for him the cSelection Textdraws
@param int color The color of the team
@param string teamName[] The Team name
@param string cInfo[] The information about the class

Example :
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    cS_Update(playerid, 0x4682B4FF, "Los Santos National Guard", "~g~]~p~ can drive fighting vehicles such as seasparrow, hydra, hunter and rhino~s~~n~~g~]~p~ full armour on spawn~s~~n~~g~]~p~ sell weapons with /wsell");
    return 1;
}
Here is a good example Test GM :


pawn Код:
#include <a_samp>
#include <cSelection>

main()
{
    print("test GM - iFarbod");
}

public OnGameModeInit()
{
    SetGameModeText("tEST Script By iFarbod");
    AddPlayerClass(287, 2775.2332, -2392.3889, 18.9217, 102.8251, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    if(!gcSDisplayed[playerid])
    {
        cS_Show(playerid);
    }
    SetPlayerPos(playerid, 2775.2332, -2392.3889, 18.9217);
    SetPlayerFacingAngle(playerid, 102.8251);
    SetPlayerCameraPos(playerid, 2766.7046, -2392.4436, 22.5008);
    SetPlayerCameraLookAt(playerid, 2767.7019, -2392.4026, 22.0358);
    ApplyAnimation(playerid, "PED", "FUCKU", 4.0, 1, 0, 0, 0, 0);
    cS_Update(playerid, 0x4682B4FF, "Los Santos National Guard", "~g~]~p~ can drive fighting vehicles such as seasparrow, hydra, hunter and rhino~s~~n~~g~]~p~ full armour on spawn~s~~n~~g~]~p~ sell weapons with /wsell~s~~n~] needs 50000 score to join");
    return 1;
}
Reply


Messages In This Thread
cSelection - Class Selection Textdraws - by iFarbod - 13.05.2014, 18:59
Re: cSelection - Class Selection Textdraws - by iFarbod - 14.05.2014, 05:37
Re: cSelection - Class Selection Textdraws - by amirab - 14.05.2014, 12:08
AW: cSelection - Class Selection Textdraws - by BigETI - 14.05.2014, 12:25
Re: AW: cSelection - Class Selection Textdraws - by iFarbod - 15.05.2014, 07:17
AW: Re: AW: cSelection - Class Selection Textdraws - by BigETI - 15.05.2014, 08:41
Re: cSelection - Class Selection Textdraws - by Admigo - 15.05.2014, 13:29
Re: cSelection - Class Selection Textdraws - by iFarbod - 15.05.2014, 14:21
Re: cSelection - Class Selection Textdraws - by Admigo - 15.05.2014, 14:40
Re: cSelection - Class Selection Textdraws - by Hwang - 18.05.2014, 09:22

Forum Jump:


Users browsing this thread: 2 Guest(s)