21.07.2012, 08:54
How To Make
A Simple DM Minigame's
With Pickups & MapIcon
A Simple DM Minigame's
With Pickups & MapIcon
//#Today im gonna show you how to make a simple DM Minigames in your server.
//# This is my First Tutorial , if i make a mistake tell me and Sorry for my bad English
//#In this Tutorial im using "ZCMD"
>> Firstly, run your server as local host then join it , then go to any buildings that u want and /save infront the buildings door
>> Picture:http://i.imgur.com/4iFGP.png
>> and then goto Document/GTA San Andreas User Files/SAMP then open savedpositions.txt
>> It will be like this;
>> *Let's get started !*;
For Interior; http://weedarr.wikidot.com/interior
For Setplayerpos; https://sampwiki.blast.hk/wiki/SetPlayerPos
For SetPlayerInterior; https://sampwiki.blast.hk/wiki/SetPlayerInterior
For SetPlayerMapIcon; https://sampwiki.blast.hk/wiki/SetPlayerMapIcon
For IsPlayerInRangeOfPoint; https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
For Creating Pickups Tutorial; https://sampforum.blast.hk/showthread.php?tid=327953
Credits to
Dev Team : a_samp includes
Zeex : ZCMD Commands Processer
Devilxz : For creating this Tutorial
//# This is my First Tutorial , if i make a mistake tell me and Sorry for my bad English
//#In this Tutorial im using "ZCMD"
>> Firstly, run your server as local host then join it , then go to any buildings that u want and /save infront the buildings door
>> Picture:http://i.imgur.com/4iFGP.png
>> and then goto Document/GTA San Andreas User Files/SAMP then open savedpositions.txt
>> It will be like this;
Код:
AddPlayerClass(0,-1782.5405,572.7006,35.1641,303.5150,0,0,0,0,0,0); //Deathmatch Spawn AddPlayerClass(models,Float:x,Float:y,Float:z,Float:angle,weapon1,ammo1,weapon2,ammo2,weapon3,ammo3); //>> You will use this 2 times , on CMD:play and CMD:leave;
pawn Код:
#include a_samp //>> Credits to SA-MP Dev Team;
#include zcmd //>> Credits to Zeex
//>> Top of your Script;
new DmMinigames[MAX_PLAYERS]; //>> Variables;
//>> Creating the Pickups
new DmMinigamesPickups;
public OnGameModeInit()
{
DmMinigamesPickups = CreatePickup(1254, 22, -1784.4821,576.0916,35.1641, -1); //Create the Pickups..
return 1;
}
public OnPlayerConnect(playerid)
{
DmMinigames[playerid] = 0; //>> Remove player from the DM Minigames when Reconnect
SetPlayerMapIcon(playerid, 12, -1784.4821,576.0916,35.1641, 23, 0, MAPICON_LOCAL); //>> Set a Skull icon on the Radar
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DmMinigames[playerid] = 0; //>> Remove player from the DM Minigames after Disconnect
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
DmMinigames[playerid] = 0; //>> when you death u will be automatically remove from the Match!
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == DmMinigamesPickups) //>> Checked the Pickups
{
GameTextForPlayer(playerid, "| /PLAY | DM Minigame's | COST:$20K |", 4000, 3); //>> if player take the pickups then it will show u some Information about the DM Minigames ..
}
return 1;
}
//----------------< The Commands To Start Play DM Minigame's >----------------//
CMD:play(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, -1784.4821,576.0916,35.1641))
//if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:x,Float:y,Float:z))
{
if(GetPlayerMoney(playerid) <20000)
return SendClientMessage(playerid, COLOR_RED2, "* You dont have enough money to Play DM Minigame's *");
//>> if(GetPlayerMoney(playerid) <20000)
//>> return SendClientMessage(playerid, COLOR_RED2, "* You dont have enough money to Play DM Minigame's *");
//>> Check if the player dont have enough money
GivePlayerMoney(playerid, -20000); //>> 20k would be taken if you play DM Minigame, u can change the price if you want..
SetPlayerPos(playerid, 1302.519897,-1.787510,1001.028259); //>> SetPlayerPos
SetPlayerInterior(playerid, 18); //>> SetPlayerInterior
SetPlayerVirtualWorld(playerid, -1); //>> -1 means all of "Virtual World"
SetPlayerArmour(playerid, 100); //>> will SetPlayerArmour to 100%
SetPlayerHealth(playerid, 100); //>> will SetPlayerHealth to 100%
GivePlayerWeapon(playerid, 24, 99999); //>> will give the player weapon ..
DmMinigames[playerid] = 1; //>> 1 to make u join the DM Minigame's
}
return 1;
}
CMD:leave(playerid, params[])
{
if(DmMinigames[playerid] == 0) //Checking;
{
SendClientMessage(playerid,COLOR_RED2,"You are not in Deathmatch Minigames to do that."); //>> Checked if u are not in DM
}
else
{
DmMinigames[playerid] = 0; //>> 0 - Will remove u from the Match
SetPlayerPos(playerid, -1784.4821,576.0916,35.1641); //>> SetYourPos Infront of the buildings door's
SetPlayerInterior(playerid, 0); //>> Will set your interior to Normal
ResetPlayerWeapons(playerid); //>> Will Reset/Remove your weapon
}
return 1;
}
//>> You want to disable other Commands when u was in DM Minigames ?
//>> Okay, Example; how to disable Cmd when in DM match
CMD:v(playerid, params[])
{
if(DmMinigames[playerid]) return SendClientMessage(playerid, COLOR_RED, "[ERROR]:{FFFFFF}You can't use these {FFFF00}commands {FFFFFF}if you are in {FF0000}DM {FFFF00}Minigames");
//>> Your code here
return 1;
}
//>> then it will Disable the Cmd when u was in DM Minigame's Match;
//##*** END OF THE SCRIPT ***##//
//>> When it was done it will be like this;
Picture:http://i.imgur.com/Avhpw.png
//>> Information;Picture:http://i.imgur.com/Avhpw.png
For Interior; http://weedarr.wikidot.com/interior
For Setplayerpos; https://sampwiki.blast.hk/wiki/SetPlayerPos
For SetPlayerInterior; https://sampwiki.blast.hk/wiki/SetPlayerInterior
For SetPlayerMapIcon; https://sampwiki.blast.hk/wiki/SetPlayerMapIcon
For IsPlayerInRangeOfPoint; https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
For Creating Pickups Tutorial; https://sampforum.blast.hk/showthread.php?tid=327953
Credits to
Dev Team : a_samp includes
Zeex : ZCMD Commands Processer
Devilxz : For creating this Tutorial