[FilterScript] Tron: A New Grid (ZCMD)
#1

Now, ive probably done the wrong format for putting scripts out. But anyway:
Here is a script that I helped develop (by which I mean i came up with the idea)
Im not so handy with Zcmd, nor hosting a server, so Ive decided anyone who wants to use this code then by all means do. Aslong as you let me know (because i want to be apart of a tron themed server )
This is a direct copy and past, and it was created by Haydz around november last year. So its a little old.

Give it a shot, any screen shots would be lovely.


pawn Код:
/*--------------------------*\
|Credits                     |
|Scripter - Haydz            |
|Mapper - Vince              |
|                            |
\*--------------------------*/

//=======Includes==========//
#include <a_samp>
#include <zcmd>
#include <sscanf>
//===========Colors============//
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GREY 0xAFAFAFFF
#define COLOR_GREEN 0x33AA33AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
//========Teams============//
new BlueTeam[MAX_PLAYERS];
new GreenTeam[MAX_PLAYERS];
new RedTeam[MAX_PLAYERS];
new YellowTeam[MAX_PLAYERS];
//=======Charged Disks=====//
new Chargeddisk[MAX_PLAYERS];
new CoruruptionDiskCharged[MAX_PLAYERS];
new PlasmaDiskCharged[MAX_PLAYERS];
new LightDiskCharged[MAX_PLAYERS];

new hurttimer;
main()
{
}
public OnGameModeInit()
{
 SetGameModeText("Gamemodename");
 AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}
public OnPlayerConnect(playerid)
{
    new pName[25],string[80];
    GetPlayerName(playerid,pName,24) && format(string,sizeof(string), "**%s has connected to the server",pName) && SendClientMessageToAll(0xFFFFFF,string);
    Chargeddisk[playerid] = 0;
    //for testing team commands
    BlueTeam[playerid] = 1;
    YellowTeam[playerid] = 1;
    GreenTeam[playerid] = 1;
    RedTeam[playerid] = 1;
    //for testing team commands
}
public OnPlayerDisconnect(playerid, reason)
{
    new string[85],Hname[24];
    switch (reason) {
        case 0: GetPlayerName(playerid,Hname,24) && format(string,sizeof(string), "%s [%d] has left the server (Timeout)",Hname,playerid) && SendClientMessageToAll(COLOR_ORANGE,string);
        case 1: GetPlayerName(playerid,Hname,24) && format(string,sizeof(string), "%s [%d] has left the server (Quit)",Hname,playerid) && SendClientMessageToAll(COLOR_ORANGE,string);
        case 2: GetPlayerName(playerid,Hname,24) && format(string,sizeof(string), "%s [%d] has left the server (Kick/Banned)",Hname,playerid) && SendClientMessageToAll(COLOR_ORANGE,string);
    }
}
public OnPlayerDeath(playerid, killerid, reason)
{
    PlasmaDiskCharged[playerid] = 0;
    KillTimer(hurttimer);
    return 1;
}
//================Blue Team====================//
COMMAND:cycle(playerid, params[])
{
    if(BlueTeam[playerid] == 1)
    {
        new nrg;
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid, x,y,z);
        CreateVehicle(522, x, y, z, 0, 0, 0, 300);
        PutPlayerInVehicle(playerid, nrg,0);
        SendClientMessage(playerid, COLOR_YELLOW,"*you take out a light capsule");
        SendClientMessage(playerid, COLOR_YELLOW,"*you pull it apart");
        SendClientMessage(playerid, COLOR_YELLOW,"*your light cycle digitizes ready to ride");
    }
    else if(RedTeam[playerid] == 1)
    {
        new nrg;
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid, x,y,z);
        CreateVehicle(522, x, y, z, 0, 0, 0, 300);
        PutPlayerInVehicle(playerid, nrg,0);
        SendClientMessage(playerid, COLOR_YELLOW,"*you take out a light capsule");
        SendClientMessage(playerid, COLOR_YELLOW,"*you pull it apart");
        SendClientMessage(playerid, COLOR_YELLOW,"*your light cycle digitizes ready to ride");
    }
    return 1;
}
COMMAND:disk(playerid, cmdtext[])
{
    if(BlueTeam[playerid] == 1) return 0;
    {
        if(Chargeddisk[playerid] == 1) return SendClientMessage(playerid, COLOR_ORANGE,"You have already charged your disk up!");
        {
            Chargeddisk[playerid] = 1;
            SendClientMessage(playerid, COLOR_YELLOW,"*you take off your Identity disk and charge it");
        }
    }
    if(GreenTeam[playerid] == 1) return 0;
    {
        if(!strlen(cmdtext)||strval(cmdtext)<1||strval(cmdtext)>3)return SendClientMessage(playerid,COLOR_YELLOW,"Usage: /disk [1,2,3]");
        new disknumber=strval(cmdtext);
        if(disknumber == 1)
        {
            SendClientMessage(playerid, COLOR_GREEN,"*you take out and charge your light disk");
            LightDiskCharged[playerid] = 1;
        }
        if(disknumber == 2)
        {
            SendClientMessage(playerid, COLOR_GREEN,"*you take out and charge your plasma disk");
            PlasmaDiskCharged[playerid] = 1;
        }
        if(disknumber == 3)
        {
            SendClientMessage(playerid, COLOR_GREEN,"*you take out and charge your coruruption disk");
            CoruruptionDiskCharged[playerid] = 1;
        }
    }
    return 1;
}
COMMAND:throw(playerid, cmdtext[])
{
    if(BlueTeam[playerid] == 1) return 0;
    {
        if(Chargeddisk[playerid] == 0) return SendClientMessage(playerid, COLOR_ORANGE,"You havn't charged your disk up yet!");
        {
            new otherplayerid;
            if(sscanf(cmdtext, "d", otherplayerid)) return SendClientMessage(playerid, COLOR_ORANGE, "Use /disk [playerid/name]");
            else if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, COLOR_ORANGE, "This player is not connected");
            else
            {
                new string[100],pName[25],gName[25];
                GetPlayerName(playerid, pName,25) && format(string, sizeof(string),"*you throw your identity disk at %s",gName) && SendClientMessage(playerid, COLOR_YELLOW,string);
                GetPlayerName(otherplayerid, gName,25) && format(string, sizeof(string),"*%s threw his identity disk at you and you lost 10 health!",pName) && SendClientMessage(playerid, COLOR_YELLOW,string);
                Chargeddisk[playerid] = 1;
                SetPlayerHealth(otherplayerid, -10);
            }
        }
    }
    if(GreenTeam[playerid] == 1) return 0;
    {
        if(!strlen(cmdtext)||strval(cmdtext)<1||strval(cmdtext)>3)return SendClientMessage(playerid,COLOR_YELLOW,"Usage: /throw [1,2,3] [ID]");
        new thrownumber=strval(cmdtext);
        if(thrownumber == 1)
        {
            new otherplayerid;
            if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, COLOR_ORANGE, "This player is not connected");
            else
            {
                new string[100],pName[25],gName[25];
                GetPlayerName(playerid, pName,25) && format(string, sizeof(string),"*you throw your light disk at %s",gName) && SendClientMessage(playerid, COLOR_YELLOW,string);
                GetPlayerName(otherplayerid, gName,25) && format(string, sizeof(string),"*%s threw his light disk at you and you lost 20 health!",pName) && SendClientMessage(playerid, COLOR_YELLOW,string);
                LightDiskCharged[playerid] = 1;
                SetPlayerHealth(otherplayerid, -20);
            }
        }
        if(thrownumber == 2)
        {
            new otherplayerid;
            if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, COLOR_ORANGE, "This player is not connected");
            else
            {
                new string[100],pName[25],gName[25];
                GetPlayerName(playerid, pName,25) && format(string, sizeof(string),"*you throw your plasma disk at %s",gName) && SendClientMessage(playerid, COLOR_YELLOW,string);
                GetPlayerName(otherplayerid, gName,25) && format(string, sizeof(string),"*%s threw his plasma disk at you and killed you!",pName) && SendClientMessage(playerid, COLOR_YELLOW,string);
                SetPlayerHealth(otherplayerid, 0);
                PlasmaDiskCharged[playerid] = 0;
            }
        }
        if(thrownumber == 3)
        {
            new otherplayerid;
            if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, COLOR_ORANGE, "This player is not connected");
            else
            {
                new string[100],pName[25],gName[25];
                GetPlayerName(playerid, pName,25) && format(string, sizeof(string),"*you throw your Coruruption disk at %s and froze them.",gName) && SendClientMessage(playerid, COLOR_YELLOW,string);
                GetPlayerName(otherplayerid, gName,25) && format(string, sizeof(string),"*%s threw his Coruruption disk at you and froze you.",pName) && SendClientMessage(playerid, COLOR_YELLOW,string);
                TogglePlayerControllable(otherplayerid,0);
                CoruruptionDiskCharged[playerid] = 0;
            }
        }
    }
    return 1;
}
COMMAND:sword(playerid, params[])
{
    if(GreenTeam[playerid] == 1) return 0;
    {
        SendClientMessage(playerid, COLOR_GREEN,"*you take out a light capsule and a blade digitises out of it");
        GivePlayerWeapon(playerid, 8,1);
    }
    return 1;
}
COMMAND:staff(playerid, params[])
{
    if(RedTeam[playerid] == 1) return 0;
    {
        SendClientMessage(playerid, COLOR_GREEN,"*you take out the light staff off of your pack and charge it");
        GivePlayerWeapon(playerid, 7,1);
    }
    return 1;
}
COMMAND:recog(playerid, params[])
{
    if(RedTeam[playerid] == 1) return 0;
    {
        new heli;
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid, x,y,z);
        CreateVehicle(497, x, y, z, 0, 0, 0, 300);
        PutPlayerInVehicle(playerid, heli,0);
        SendClientMessage(playerid, COLOR_YELLOW,"*you throw your disk upwards");
        SendClientMessage(playerid, COLOR_YELLOW,"*a recogniser flies over you and lands");
    }
    return 1;
}
COMMAND:infect(playerid, params[])
{
    if(YellowTeam[playerid] == 1) return 0;
    {
        new otherplayerid;
        if(sscanf(params, "d", otherplayerid)) return SendClientMessage(playerid, COLOR_ORANGE, "Use /infect [playerid/name]");
        else if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, COLOR_ORANGE, "This player is not connected");
        else
        {
            new string[100],pName[25],gName[25];
            GetPlayerName(playerid, pName,25) && format(string, sizeof(string),"*you infected %s",gName) && SendClientMessage(playerid, COLOR_YELLOW,string);
            GetPlayerName(otherplayerid, gName,25) && format(string, sizeof(string),"*%s infected you and you lost 10 health!",pName) && SendClientMessage(playerid, COLOR_YELLOW,string);
            SetPlayerHealth(otherplayerid, -10);
        }
    }
    return 1;
}
COMMAND:vd(playerid, params[])
{
    if(YellowTeam[playerid] == 1) return 0;
    {
        new otherplayerid,Float:x,Float:y,Float:z;
        if(sscanf(params, "d", otherplayerid)) return SendClientMessage(playerid, COLOR_ORANGE, "Use /vd [playerid/name]");
        else if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, COLOR_ORANGE, "This player is not connected");
        else
        GetPlayerPos(otherplayerid,x,y,z);
        if(IsPlayerInRangeOfPoint(playerid, 1.0, x, y, z)) return SendClientMessage(playerid, COLOR_YELLOW,"You're not near that player!");

        {
            new string[100],pName[25],gName[25];
            GetPlayerName(playerid, pName,25) && format(string, sizeof(string),"*you vd %s",gName) && SendClientMessage(playerid, COLOR_YELLOW,string);
            GetPlayerName(otherplayerid, gName,25) && format(string, sizeof(string),"*%s vd you and you will loose 10 health every 3 seconds.!",pName) && SendClientMessage(playerid, COLOR_YELLOW,string);
            hurttimer = SetTimerEx("hurtplayer",3000,true,"d",otherplayerid);
        }
    }
    return 1;
}
forward hurtplayer(playerid);
public hurtplayer(playerid)
{
    SetPlayerHealth(playerid, -10);
    SendClientMessage(playerid,COLOR_YELLOW,"You lost 10 health!");
}
Reply
#2

you should use

pawn Код:
code goes here
[.pawn.] (without the dots)
Reply
#3

Thanks, i knew i was forgetting something
Reply
#4

Or why not just use pastebin?
Reply
#5

Ok, im keeping it like that. Thats all the code. So If you want to use it, you can. But suggestions about how to put it on a topic arent helpful any more.
Reply
#6

It is very easy. But good job. +
Reply
#7

Good Job, But, there are some bugs over there
Reply
#8

ye fix bugs ,but nice release.
Reply
#9

yea gooooooooooooooooooooood work.....dude +1 reputation....hope you will also gie me +1 reputation in back !
Reply
#10

I honestly cant figure out whats wrong with it. Pawno says it compiles. If you can figure out whats wrong with it, your welcome to try.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)