13.05.2014, 18:59
(
Последний раз редактировалось iFarbod; 18.05.2014 в 11:59.
)
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*:
* 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 :
cS_Hide(playerid);
@param int playerid The player id to hide for him the cSelection Textdraws
Example :
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 :
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[]);
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;
}