Brackets -
Black Axe - 29.11.2011
Well..First of All - Hello Everybody , I Am new to Scripting and i really want to learn , Anyway..
I made this Code :
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerInterior(playerid,0);
SetPlayerPos( playerid, 1455.2064, -785.1923, 99.8605 );
SetPlayerFacingAngle( playerid, 139.1213 );
SetPlayerCameraPos( playerid, 1453.343, -787.109, 100.860 );
SetPlayerCameraLookAt( playerid, 1455.2064, -785.1923, 99.8605 );
ApplyAnimation( playerid, "DANCING", "DNCE_M_B", 4.0, 1, 0, 0, 0, -1 );
PlayerPlaySound( playerid, 1097, -119.9460, 23.1096, 12.2238 );
}
I want to add this to it :
PHP код:
public OnPlayerRequestClass( playerid, classid ) // This is called when a player is on class selection
{
switch ( classid ) // This is like a if/elseif statement.
{
case 0: // If the classid is 0
{ // Then
GameTextForPlayer( playerid, "~r~TEAM Ballas", 300, 3 ); // Sends a gametext for player // ~r~ is a red color in gametext. // Arguments : Player ID, const string[ ], time ( milliseconds ), style // Wiki for more info
SetPlayerTeam( playerid, TEAM_BALLAS ); // Sets the player's team to TEAM_BALLAS
}
case 1: // If the classid is 1
{ // Then
GameTextForPlayer( playerid, "~g~TEAM CJ", 300, 3 ); // Sends a gametext for player // ~g~ is a green color in gametext. // Arguments : Player ID, const string[ ], time ( milliseconds ), style // Wiki for more info
SetPlayerTeam( playerid, TEAM_CJ ); // Sets the player's team to TEAM_CJ }
case 2: // If the classid is 2
{ // Then
GameTextForPlayer( playerid, "~g~TEAM CJ", 300, 3 ); // Sends a gametext for player // ~g~ is a green color in gametext. // Arguments : Player ID, const string[ ], time ( milliseconds ), style // Wiki for more info
SetPlayerTeam( playerid, TEAM_CJ ); // Sets the player's team to TEAM_CJ
}
}
return 1; // This means the callback is executed succesfully AFAIK.}
- Any Help would be Appreciated And i really want to know how to open the bracket again under PlayerPlaySound to add those
Re: Brackets -
Kingunit - 29.11.2011
I don't understand it: maybe this can help?
https://sampwiki.blast.hk/wiki/PlayerPlaySound
Re: Brackets -
Black Axe - 29.11.2011
Well , Not Really - That's not what i am asking about , The 2 Codes i Posted above - I Want to mix them..I Mean to put the BOTH codes under OnPlayerRequestClass - So how to a new Bracket after this
PHP код:
PlayerPlaySound( playerid, 1097, -119.9460, 23.1096, 12.2238 );
}
and add this under it :
PHP код:
{
switch ( classid ) // This is like a if/elseif statement.
{
case 0: // If the classid is 0
{ // Then
GameTextForPlayer( playerid, "~r~TEAM Ballas", 300, 3 ); // Sends a gametext for player // ~r~ is a red color in gametext. // Arguments : Player ID, const string[ ], time ( milliseconds ), style // Wiki for more info
SetPlayerTeam( playerid, TEAM_BALLAS ); // Sets the player's team to TEAM_BALLAS
}
case 1: // If the classid is 1
{ // Then
GameTextForPlayer( playerid, "~g~TEAM CJ", 300, 3 ); // Sends a gametext for player // ~g~ is a green color in gametext. // Arguments : Player ID, const string[ ], time ( milliseconds ), style // Wiki for more info
SetPlayerTeam( playerid, TEAM_CJ ); // Sets the player's team to TEAM_CJ }
case 2: // If the classid is 2
{ // Then
GameTextForPlayer( playerid, "~g~TEAM CJ", 300, 3 ); // Sends a gametext for player // ~g~ is a green color in gametext. // Arguments : Player ID, const string[ ], time ( milliseconds ), style // Wiki for more info
SetPlayerTeam( playerid, TEAM_CJ ); // Sets the player's team to TEAM_CJ
}
}
return 1; // This means the callback is executed succesfully AFAIK.}
Re: Brackets -
Kingunit - 29.11.2011
pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
SetPlayerInterior(playerid,0);
SetPlayerPos( playerid, 1455.2064, -785.1923, 99.8605 );
SetPlayerFacingAngle( playerid, 139.1213 );
SetPlayerCameraPos( playerid, 1453.343, -787.109, 100.860 );
SetPlayerCameraLookAt( playerid, 1455.2064, -785.1923, 99.8605 );
ApplyAnimation( playerid, "DANCING", "DNCE_M_B", 4.0, 1, 0, 0, 0, -1 );
PlayerPlaySound( playerid, 1097, -119.9460, 23.1096, 12.2238 );
switch ( classid )
{
case 0:
{
GameTextForPlayer( playerid, "~r~TEAM Ballas", 300, 3 );
SetPlayerTeam( playerid, TEAM_BALLAS );
}
case 1:
{
GameTextForPlayer( playerid, "~g~TEAM CJ", 300, 3 );
SetPlayerTeam( playerid, TEAM_CJ );
}
case 2:
{
GameTextForPlayer( playerid, "~g~TEAM CJ", 300, 3 );
SetPlayerTeam( playerid, TEAM_CJ );
}
}
return 1;
}
Re: Brackets -
Kostas' - 29.11.2011
pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
switch ( classid ) {
case 0:
{
GameTextForPlayer( playerid, "~r~TEAM Ballas", 300, 3 );
SetPlayerTeam( playerid, TEAM_BALLAS );
}
case 1:
{
GameTextForPlayer( playerid, "~g~TEAM CJ", 300, 3 );
SetPlayerTeam( playerid, TEAM_CJ );
}
case 2:
{
GameTextForPlayer( playerid, "~g~TEAM CJ", 300, 3 );
SetPlayerTeam( playerid, TEAM_CJ );
}
}
return 1;
}
Edit: People above were faster
Re: Brackets -
Black Axe - 29.11.2011
Really Thank you Guys - I Added for both of you Reputation [Too Bad my Reputation Points Don't Count Yet]