OnClientScriptData: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
Kennedyarz (talk | contribs) (Created page with "function onClientScriptData(player) Example: ::Python <- GUIButton(VectorScreen(400,200), VectorScreen(200, 22), Colour(75,75,75), "Python (6) Cost(6)", GUI_FLAG_BORDER |...") |
Kennedyarz (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
function onClientScriptData(player) | == Syntax == | ||
<pre>function onClientScriptData(player)</pre> | |||
== Arguments == | |||
* '''player''' - Player who is spawning. | |||
* '''GuiButton''' - GUI Button. | |||
== Example == | |||
<source lang="squirrel"> | |||
function Script::ScriptLoad() | |||
{ | |||
::Python <- GUIButton(VectorScreen(400,200), VectorScreen(200, 22), Colour(75,75,75), "Python (6) Cost(6)", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE); | ::Python <- GUIButton(VectorScreen(400,200), VectorScreen(200, 22), Colour(75,75,75), "Python (6) Cost(6)", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE); | ||
} | |||
function GUI::ElementClick(element, mouseX, mouseY) | function GUI::ElementClick(element, mouseX, mouseY) | ||
Line 12: | Line 24: | ||
Datos.WriteString("python"); | Datos.WriteString("python"); | ||
Server.SendData(Datos); | Server.SendData(Datos); | ||
} | |||
} | } | ||
function onClientScriptData(player) | function onClientScriptData(player) | ||
{ | { | ||
if(string=="python") | if(string=="python") | ||
{ | { | ||
player.GiveWeapon(18, | player.GiveWeapon(18,100000); | ||
} | } | ||
} | } | ||
</source> | |||
== Related Functions == | |||
{{Scripting/Squirrel/Events/Player_Events}} | |||
[[Category:Scripting/Squirrel/Events/Player_Events]] |
Latest revision as of 13:49, 14 March 2017
Syntax
function onClientScriptData(player)
Arguments
- player - Player who is spawning.
- GuiButton - GUI Button.
Example
function Script::ScriptLoad()
{
::Python <- GUIButton(VectorScreen(400,200), VectorScreen(200, 22), Colour(75,75,75), "Python (6) Cost(6)", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
}
function GUI::ElementClick(element, mouseX, mouseY)
{
if (element == Python)
{
local Datos = Stream();
Datos.WriteString("python");
Server.SendData(Datos);
}
}
function onClientScriptData(player)
{
if(string=="python")
{
player.GiveWeapon(18,100000);
}
}
Related Functions
- onPlayerJoin( player )
- onPlayerPart( player, reason )
- onPlayerRequestClass( player, classID )
- onPlayerRequestSpawn( player )
- onPlayerSpawn( player )
- onPlayerDeath( player, reason )
- onPlayerKill( killer, player, reason, bodypart )
- onPlayerTeamKill( killer, player, reason, bodypart )
- onPlayerChat( player, message )
- onPlayerCommand( player, command, arguments )
- onPlayerPM( player, playerTo, message )
- onPlayerBeginTyping( player )
- onPlayerEndTyping( player )
- onLoginAttempt( playerName, password, ipAddress )
- onNameChangeable( player ) // Currently can't work.
- onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
- onPlayerHealthChange( player, lastHP, newHP )
- onPlayerArmourChange( player, lastArmour, newArmour )
- onPlayerWeaponChange( player, oldWep, newWep )
- onKeyDown( player, bindID )
- onKeyUp( player, bindID )
- onPlayerAwayChange( player, newStatus )
- onPlayerSpectate( player, target )
- onPlayerCrashDump( player, crashReport )
- onPlayerNameChange( player, oldName, newName )
- onPlayerActionChange( player, oldAction, newAction )
- onPlayerStateChange( player, oldState, newState )
- onPlayerOnFireChange( player, isOnFireNow )
- onPlayerCrouchChange( player, isCrouchingNow )
- onPlayerGameKeysChange( player, oldKeys, newKeys )