Thread: [Release] [ANY?] Player Size
View Single Post
Psikotik
Member
Join Date: May 2013
Old 05-02-2013 , 17:35   Re: [ANY?] Player Size
Reply With Quote #12

His work with a menu you can change the size of the player in the script

Quote:
#include <sourcemod>
#include <morecolors>




new Taill[MAXPLAYERS+1] = 0;


public OnPluginStart()
{
HookEvent("player_spawn", PlayerSpawn);
RegAdminCmd("sm_taille", Command, ADMFLAG_CUSTOM1);
}


public Action:Command(client, args)
{
Menu(client);
}


public Action:Menu(client)
{
if(IsPlayerAlive(client))
{
new Handle:menu = INVALID_HANDLE;
menu = CreateMenu(Choix);
SetMenuTitle(menu, "Choix de votre Taille : \n ");
AddMenuItem(menu, "", "- Taille Normale");
AddMenuItem(menu, "", "- Petite Taille");
AddMenuItem(menu, "", "- Grande Taille");
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
}


public ActionlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event,"userid") );
if (IsClientInGame(client))
{
if (Taill[client] == 0)
{
SetEntPropFloat(client, Prop_Send, "m_flModelScale", 1.0);
}
else if (Taill[client] == 1)
{
PrintHintText(client, "{cyan}[VIP]{green} Vous êtes petit (Tapez !taille)");
SetEntPropFloat(client, Prop_Send, "m_flModelScale", 0.7);
}
else if (Taill[client] == 2)
{
PrintHintText(client, "{cyan}[VIP]{green} Vous êtes grand (Tapez !taille)");
SetEntPropFloat(client, Prop_Send, "m_flModelScale", 1.3);
}
}
}


public Choix(Handle:menu, MenuAction:action, client, itemNum)
{
if ( action == MenuAction_Select )
{
switch (itemNum)
{
case 0:
{
CPrintToChat(client,"{cyan}[VIP]{green} Vous etes de taille : {lightgreen}Normale");
SetEntPropFloat(client, Prop_Send, "m_flModelScale", 1.0);
}
case 1:
{
CPrintToChat(client,"{cyan}[VIP]{green} Vous etes de taille : {lightgreen}Petite");
SetEntPropFloat(client, Prop_Send, "m_flModelScale", 0.7);
}
case 2:
{
CPrintToChat(client,"{cyan}[VIP]{green} Vous etes de taille : {lightgreen}Grande");
SetEntPropFloat(client, Prop_Send, "m_flModelScale", 1.3);
}
}
}


}
Psikotik is offline