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;
#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 ***##//
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");
if(DmMinigames[playerid] == 1)
//OnPlayerDeath
DmMinigames[playerid] = 0;
pawn Код:
pawn Код:
pawn Код:
|
pawn Код:
pawn Код:
|
YCMD:leave(playerid, params[], help) { #pragma unused help #pragma unused params if(MinigameDM1[playerid] == 0) { SendClientMessage(playerid,COLOR_RED2,"You are not in Deathmatch Minigames to do that."); } else { MinigameDM1[playerid] = 0; SetPlayerPos(playerid, 2027.8263,1322.6852,10.8203); SetPlayerInterior(playerid, 0); ResetPlayerWeapons(playerid); } return 1; |
when I enter the mingame and leave the minigame my cars have gone how would I respawn the cars under leave function...
|
this is really good tut for beginners. that trying to learn stuff hope more come soon!!! 10/10 very nice and understanding.
|