[GameMode] TDM Basic, [Zcmd] [Basic]
#1

Hi all !
today i did this small gamemode... basic TDM
before post the server, guys, tell me how to change the tittle of this thread ?
well this is my "tdm basic"
also basic cmds..
pawn Код:
#include <a_samp>
#include <zcmd> //define this
#include <dini> // this
#include <dudb> ///this
#include <sscanf2> // and this
// we need define zcmd before do the cmds..!

//the teams
#define TEAM_GROVE 1
#define TEAM_BALLAS 2
#define TEAM_Vagos 3
#define TEAM_Aztecs 4

#define GetName(%1,%2) new %2[MAX_PLAYER_NAME]; GetPlayerName(%1,%2,MAX_PLAYER_NAME)

#define TEAM_GROVE_COLOR 0x00FF00AA
#define TEAM_BALLAS_COLOR 0xFF00FFAA
#define TEAM_Vagos_COLOR 0xFFFF00AA
#define TEAM_Aztecs_COLOR 0x00C2ECFF

new gTeam[MAX_PLAYERS];
new giveplayerid;

main()
{

        print("\n----------------------------------");
        print(" Basic TDM for sa-mp.com by RafaelZam");
        print("----------------------------------\n");
}

public OnGameModeInit()
{
        SetGameModeText("Gangs War v1.0 tutorial");

        AddPlayerClass(105, 2512.0581, -1672.3823, 13.4813, 66.2349, WEAPON_KNIFE, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_TEC9, 0x7FFFFFFF); //This is classid 0
        AddPlayerClass(106, 2512.0581, -1672.3823, 13.4813, 66.2349, WEAPON_KNIFE, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_TEC9, 0x7FFFFFFF); //Classid 1
        AddPlayerClass(107, 2512.0581, -1672.3823, 13.4813, 66.2349, WEAPON_KNIFE, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_TEC9, 0x7FFFFFFF); //Classid 2
        AddPlayerClass(102, 2172.8787, -1672.7426, 15.0859, 286.4139, WEAPON_BAT, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_UZI, 0x7FFFFFFF); //Classid 3
        AddPlayerClass(103, 2172.8787, -1672.7426, 15.0859, 286.4139, WEAPON_BAT, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_UZI, 0x7FFFFFFF); //Classid 4
        AddPlayerClass(104, 2172.8787, -1672.7426, 15.0859, 286.4139, WEAPON_BAT, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_UZI, 0x7FFFFFFF); //Classid 5
        AddPlayerClass(108,2541.5249,-1033.1189,69.5793,177.4599,WEAPON_KNIFE, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_TEC9, 0x7FFFFFFF); // vagos
        AddPlayerClass(109,2541.5249,-1033.1189,69.5793,177.4599,WEAPON_KNIFE, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_TEC9, 0x7FFFFFFF); // vagos
        AddPlayerClass(110,2541.5249,-1033.1189,69.5793,177.4599,WEAPON_KNIFE, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_TEC9, 0x7FFFFFFF); // vagos
        AddPlayerClass(114,1715.0638,-2124.4746,14.0566,357.3774,WEAPON_BAT, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_UZI, 0x7FFFFFFF); // Aztecs
        AddPlayerClass(115,1715.0638,-2124.4746,14.0566,357.3774,WEAPON_BAT, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_UZI, 0x7FFFFFFF); // Aztecs
        AddPlayerClass(116,1715.0638,-2124.4746,14.0566,357.3774,WEAPON_BAT, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_UZI, 0x7FFFFFFF); // Aztecs
       
        return 1;
}

public OnGameModeExit()
{
        return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
        SetPlayerPos(playerid, 2121.7322, -1623.2563, 26.8368);
        SetPlayerFacingAngle(playerid, 60.2360);
        SetPlayerCameraPos(playerid, 2111.9089 ,-1623.7340, 24.2307);
        SetPlayerCameraLookAt(playerid, 2121.7322, -1623.2563, 26.8368);

        switch(classid)
        {
    case 0,1,2:
    {
        GameTextForPlayer(playerid, "~g~GROVE~w~", 3000, 5);
        SetPlayerTeam(playerid, TEAM_GROVE);
        gTeam[playerid] = TEAM_GROVE;
        SetPlayerColor(playerid, TEAM_GROVE_COLOR);
    }
        //The same, but for the Ballas.
    case 3,4,5:
    {
         GameTextForPlayer(playerid, "~b~BALLAS~w~", 3000, 5);
         SetPlayerTeam(playerid, TEAM_BALLAS);
         gTeam[playerid] = TEAM_BALLAS;
         SetPlayerColor(playerid, TEAM_BALLAS_COLOR);
        }
        case 6,7,8:
        {
                GameTextForPlayer(playerid, "~y~Vagos~w~", 3000, 5);
                SetPlayerTeam(playerid, TEAM_Vagos);
                gTeam[playerid] = TEAM_Vagos;
                SetPlayerColor(playerid, TEAM_Vagos_COLOR);
        }
        case 9,10,11:
        {
                GameTextForPlayer(playerid, "~bl~Aztecs~w~", 3000, 5);
                SetPlayerTeam(playerid, TEAM_Aztecs);
                gTeam[playerid] = TEAM_Aztecs;
                SetPlayerColor(playerid, TEAM_Aztecs_COLOR);
                }
        }
        return 1;
}

SetPlayerToTeamColor(playerid)
{

        if (gTeam[playerid] == TEAM_GROVE)
        {
                SetPlayerColor(playerid, TEAM_GROVE_COLOR);
        }
        else if (gTeam[playerid] == TEAM_BALLAS)
        {
                SetPlayerColor(playerid, TEAM_BALLAS_COLOR);
        }
        else if (gTeam[playerid] == TEAM_Vagos)
        {
                SetPlayerColor(playerid, TEAM_Vagos_COLOR);
        }
        else if (gTeam[playerid] == TEAM_Aztecs)
        {
                SetPlayerColor(playerid, TEAM_Aztecs_COLOR);
        }
}

public OnPlayerConnect(playerid)
{
        return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
        return 1;
}

public OnPlayerSpawn(playerid)
{
        SetPlayerToTeamColor(playerid);
        return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
        SendDeathMessage(killerid, playerid, reason);
        return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    return 1;
}
CMD:kill(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You cannot kill yourself in any vehicle!");
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    if(Health < 20) return SendClientMessage(playerid, -1, "You are too weak to kill yourself");
    SetPlayerHealth(playerid, 0);
    SendClientMessage(playerid, -1, " You've succesfully killed yourself");
    return 1;
}
CMD:rules(playerid, params[])
{
    SendClientMessage(playerid, -1,"Not Cheating");
    SendClientMessage(playerid, -1,"Not insult");
    SendClientMessage(playerid, -1,"don't use mods that isn't allowed");
    SendClientMessage(playerid, -1,"Don't download porn while you're playing");
    SendClientMessage(playerid, -1,"is only a game, we don't need flame or be racis, racism = ban");
    return 1;
}
CMD:register(playerid,params[])
{
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
    if(udb_Exists(playername)) return SendClientMessage(playerid, -1,"Account already exists, please use '/login password'.");
    if(strlen(params)==0) return SendClientMessage(playerid, -1,"Correct usage: '/register password'");
    if(udb_Create(playername,params))
    {
        SendClientMessage(playerid, -1,"Account successfully created. Login with '/login password' now.");
        GivePlayerMoney(playerid,5000);
    }
    return 1;
}
CMD:givecash(playerid, params[])
   {
        new amount, str[128];
        if(sscanf(params, "ud", giveplayerid, amount)) return SendClientMessage(playerid, -1, "Correct usage: '/givecash [playername] [amount]'");
        if(!IsPlayerConnected(giveplayerid) || giveplayerid == playerid) return SendClientMessage(playerid, -1, "This player is not active.");
        if(amount < 1 || amount > GetPlayerMoney(playerid)) return SendClientMessage(playerid, -1, "Invalid amount!");
        GetName(playerid, playername);
        GetName(giveplayerid, giveplayer);
        GivePlayerMoney(playerid, -amount);
        GivePlayerMoney(giveplayerid, amount);
        format(str, sizeof(str), "You have sent $%d to %s (%d)", amount, giveplayer, giveplayerid);
        SendClientMessage(playerid,-1, str);
        format(str, sizeof(str), "%s (%d) has sent you $%d", playername, playerid, amount);
        return 1;
   }
CMD:resetstats(playerid, params[])
   {
      if(IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, " invalid player, he's maybe office");
      if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, " use /resetstats to reset the stats of any player...");
      if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, " you're in a veh, get down and try again");
      ResetPlayerMoney(playerid);
      ResetPlayerWeapons(playerid);
      SpawnPlayer(playerid);
      SetPlayerScore(playerid, 0);
      SetPlayerArmour(playerid, 0.0);
      SetPlayerSkillLevel(playerid, 1, 0);
      SendClientMessageToAll(playerid," %s has used /ResetStats now he's a newbie again");
      return 1;
}
CMD:spawn(playerid, params[])
{
    SpawnPlayer(playerid);
    SendClientMessage(playerid, -1, "spawned");
    return 1;
}
COMMAND:ep(playerid, params[])
{
    SendClientMessage(playerid, -1, "* Emergency parachute recieved.");
    GivePlayerWeapon(playerid, 46, 1);
    return 1;
}
Thank you guys
i will upload some links for you !
download here
http://www.solidfiles.com/d/221110950e/
Reply
#2

Nice it's good for newbies but fix this: -

Код:
CMD:cmds(playerid, params[])
{
    SendClientMessage(playerid, -1,"Not Cheating");
    SendClientMessage(playerid, -1,"Not insult");
    SendClientMessage(playerid, -1,"don't use mods that isn't allowed");
    SendClientMessage(playerid, -1,"Don't download porn while you're playing");
    SendClientMessage(playerid, -1,"is only a game, we don't need flame or be racis, racism = ban");
    return 1;
}
i think it's miss typo, seems like /rules command.

but i like this part: -
Код:
SendClientMessage(playerid, -1,"Don't download porn while you're playing");
LOL
Reply
#3

Quote:
Originally Posted by xF4Life
Посмотреть сообщение
Nice it's good for newbies but fix this: -

Код:
CMD:cmds(playerid, params[])
{
    SendClientMessage(playerid, -1,"Not Cheating");
    SendClientMessage(playerid, -1,"Not insult");
    SendClientMessage(playerid, -1,"don't use mods that isn't allowed");
    SendClientMessage(playerid, -1,"Don't download porn while you're playing");
    SendClientMessage(playerid, -1,"is only a game, we don't need flame or be racis, racism = ban");
    return 1;
}
i think it's miss typo, seems like /rules command.

but i like this part: -
Код:
SendClientMessage(playerid, -1,"Don't download porn while you're playing");
LOL
ohhh thank you xD
fixed !
"Don't download porn while you're playing"
hahahaha thats to avoid lag while play D: xD
Reply
#4

Very basic. I like it.
Reply
#5

Thank youfacetutorialz
Reply
#6

Yeah, not bad 7.5/10
Reply
#7

ty, i'm doing other Game Mode right now
Reply
#8

Pretty simple.
but nice, still nice.
Reply
#9

nice script.
Reply
#10

thank you badboy and parka C:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)