20.02.2011, 20:11
(
Last edited by [WTF]Godfather; 24/02/2011 at 07:47 PM.
)
Gamemode Tutorial [FIXED]
Introduction:
Hi all today i will show you how to make an a easy gamemode tutorial, for newbies , new scripters
First of all
let's use our Base Include "#include <a_samp>"
We're done of including the base samp include
Ok now let's define our team's
We have finish this step
Now on the top of the script make this little code:
Now to the next step
Create this lines:
AddPlayerClass(skinid, x, y. z, z_angle, weapon1 ,weapon1_ammo, weapon2, weapon2_ammo);
Go in game make /save TEAM then go to My documents then Gta san andreas files =>SAMP=>savedpostions.txt
Then copy the coordinates and make it
Good we've ended of OnGameModeInit();
Now write this script
Good now we will set the colour of our TEAMS
Now we've end this step
Moving to the next step
Making a view of the player when you are choosing teams
Good we've ended
Go in to the next step
When a player connect we will send him a welcome message
Done this step
Now when the player dies we will send him a message and get -500 $ of him and give the killer +1 score and + 500 $
Done
we've done our GAMEMODE Tutorial
If there's any error or any request please feel free to post!!
Introduction:
Hi all today i will show you how to make an a easy gamemode tutorial, for newbies , new scripters
First of all
let's use our Base Include "#include <a_samp>"
pawn Code:
#include <a_samp>
Ok now let's define our team's
pawn Code:
#define TEAM_USA 1
#define TEAM_COLOR_USA COLOR_BLUE //Defining the COLOUR Of this team
#define TEAM_ARABE 2
#define TEAM_COLOR_ARABE COLOR_GREEN //Defining the COLOUR OF This team
//Let's define the colours:
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_BLUE 0x0000FFFF
#define COLOR_RED 0xFF0000C7
#define COLOR_GREEN 0x00FF00D0
Now on the top of the script make this little code:
pawn Code:
new gTeam[MAX_PLAYERS];
Create this lines:
AddPlayerClass(skinid, x, y. z, z_angle, weapon1 ,weapon1_ammo, weapon2, weapon2_ammo);
Go in game make /save TEAM then go to My documents then Gta san andreas files =>SAMP=>savedpostions.txt
Then copy the coordinates and make it
pawn Code:
public OnGameModeInit()
{
AddPlayerClass(123,435.6286,2541.2283,19.2019,178.5884,0,0,0,0,0,0); // USA
AddPlayerClass(70,-220.9162,2619.3599,62.7527,186.1895,0,0,0,0,0,0); // ARABE
//////////////////Let's set the name of our gamemode////////////////
SetGameModeText("GameMode V0.1");//you can choose the name you want!!
return 1;
}
Now write this script
pawn Code:
SetPlayerTeamFromClass(playerid, classid)//When you connect is show the skin of the player now we are adding the name when you want to choose a team
{
if(classid == 0)
{
gTeam[playerid] = TEAM_ARABE;
GameTextForPlayer(playerid,"~g~Arabe Team",1000,4);//Arabe GameText
}
else if(classid == 1)
{
gTeam[playerid] = TEAM_USA;
GameTextForPlayer(playerid,"~b~United States Of America",1000,4);//USA GameText
}
return 1;
}
pawn Code:
SetPlayerToTeamColour(playerid)
{
if(gTeam[playerid] == TEAM_USA)
{
SetPlayerColor(playerid,TEAM_COLOR_USA);
}
else if(gTeam[playerid] == TEAM_ARABE)
{
SetPlayerColor(playerid,TEAM_COLOR_ARABE);
}
return 1;
}
Moving to the next step
Making a view of the player when you are choosing teams
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid,220.3261,1822.9734,7.5368);//The Place postion
SetPlayerCameraLookAt(playerid,220.3261,1822.9734,7.5368);//Camera Look at the player
SetPlayerCameraPos(playerid,226.7491,1823.0441,7.4141);//Camera Postiion
SetPlayerFacingAngle(playerid, 270 );//The Facing Angle
SetPlayerTeamFromClass(playerid, classid);//It set's the player to the choosing team
return 1;
}
Go in to the next step
When a player connect we will send him a welcome message
pawn Code:
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,COLOR_RED,"Welcome to X Server");
SendClientMessage(playerid,COLOR_RED,"Type /rules, to see the server rules");
return 1;
}
Now when the player dies we will send him a message and get -500 $ of him and give the killer +1 score and + 500 $
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
SendClientMessage(killerid, COLOR_GREEN, "You got +$500 money and +1 score for killing an enemy!");
GivePlayerMoney(killerid,500);
GivePlayerMoney(playerid,-500);
SendClientMessage(playerid, COLOR_RED, "You lost -$500 money for dieing!, BITCH!");
SendClientMessage(killerid, COLOR_GREEN,"Stats Saved");
return 1;
}
we've done our GAMEMODE Tutorial
If there's any error or any request please feel free to post!!