SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 07/10/2011, 07:41 PM   #1
DaRkAnGeL[NBK]
Huge Clucker
 
DaRkAnGeL[NBK]'s Avatar
 
Join Date: Sep 2011
Location: Nottingham
Posts: 273
Reputation: 2
Default [HELP] Need Someone To Build My Filterscript

Hey,

i have a problem that is really to begin to annoy me as i have a good idea for a new TDM filterscript but i have no idea how to script it, its fairly basic idea:

its based in cityhall and the object of the game is to defend your money bag while trying to retreve the other. each round will last for 5minutes unless the other team capture the moneybag and take it to there base located either top floor or bottom. each win will be decided on the amout of bags captured. at the start of a new round the is a 5second frozen countdown to make the game fair.
players can teleport to the minigame via /chdm which should spawn them at there spawn points
if a player dies in that minigame then they shall spawn back at there spawn base
there are also 2 teams Army or Terroist
oh and they leave by /chdmq

i shall give the other info like spawn points if you think you can do it please reply
DaRkAnGeL[NBK] is offline   Reply With Quote
Old 07/10/2011, 08:06 PM   #2
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 933
Reputation: 143
Default Re: [HELP] Need Someone To Build My Filterscript

That's something like a minigame (or maybe biggame??) xD
It's pretty easy to do, just need some PAWN knowledge
Try starting you own and ask for help here if you need it!
__________________
All my works
I left SA:MP! Maybe once I start scripting again but now I'm based on web programming
Soon, I'll buy domain system32.com.hr but for now you can contact me on LogoOff or on my Youtube channel!
System64 is offline   Reply With Quote
Old 07/10/2011, 08:10 PM   #3
DaRkAnGeL[NBK]
Huge Clucker
 
DaRkAnGeL[NBK]'s Avatar
 
Join Date: Sep 2011
Location: Nottingham
Posts: 273
Reputation: 2
Default Re: [HELP] Need Someone To Build My Filterscript

i tryed and tryed to do it my self everything went wrong so i thought i would ask basically i need to find out how to create a team selection. how to do the whole capture the flag kinda thing and also how to spawn my players there
DaRkAnGeL[NBK] is offline   Reply With Quote
Old 07/10/2011, 08:12 PM   #4
DaRkAnGeL[NBK]
Huge Clucker
 
DaRkAnGeL[NBK]'s Avatar
 
Join Date: Sep 2011
Location: Nottingham
Posts: 273
Reputation: 2
Default Re: [HELP] Need Someone To Build My Filterscript

PHP Code:
/* Army VS Terriost simple TDM filterscript which consists of two teams Army And Terriosts army are green terriosts red
the objective is simple capture the other teams money bag and take it to your base i dont mind you using this
filterscript but you must keep all credits */
#define FILTERSCRIPT

#include <a_samp>

//defines for the teams

#define TEAM_ARMY
#define TEAM_TERRORIST
#define COLOR_TERRORIST 0xB30404FF
#define COLOR_ARMY 0x005701FF
new gTeam[MAX_PLAYERS];

public 
OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Army Vs Terriosts");
    print(
"--------------------------------------\n");
    return 
1;
}

public 
OnFilterScriptExit()
{
    return 
1;
}

public 
OnPlayerSpawn(playerid)
{
    
SetPlayerToTeamColor(playerid);
    return 
1;
}
SetPlayerToTeamColor(playerid)
{
    if (
gTeam[playerid] == TEAM_ARMY)
    {
        
SetPlayerColor(playeridCOLOR_ARMY);
    }
    else if (
gTeam[playerid] == TEAM_TERRORIST)
    {
        
SetPlayerColor(playeridCOLOR_TERRORIST);
    }
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    return 
1;
}

public 
OnVehicleSpawn(vehicleid)
{
    return 
1;
}

public 
OnVehicleDeath(vehicleidkillerid)
{
    return 
1;
}

public 
OnPlayerText(playeridtext[])
{
    return 
1;
}

public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/mycommand"cmdtexttrue10) == 0)
    {
        
// Do something here
        
return 1;
    }
    return 
0;
}

public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    return 
1;
}

public 
OnPlayerExitVehicle(playeridvehicleid)
{
    return 
1;
}

public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    return 
1;
}

public 
OnPlayerEnterCheckpoint(playerid)
{
    return 
1;
}

public 
OnPlayerLeaveCheckpoint(playerid)
{
    return 
1;
}

public 
OnPlayerEnterRaceCheckpoint(playerid)
{
    return 
1;
}

public 
OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 
1;
}

public 
OnRconCommand(cmd[])
{
    return 
1;
}

public 
OnPlayerRequestSpawn(playerid)
{
    return 
1;
}

public 
OnObjectMoved(objectid)
{
    return 
1;
}

public 
OnPlayerObjectMoved(playeridobjectid)
{
    return 
1;
}

public 
OnPlayerPickUpPickup(playeridpickupid)
{
    return 
1;
}

public 
OnPlayerSelectedMenuRow(playeridrow)
{
    return 
1;
}

public 
OnPlayerInteriorChange(playeridnewinterioridoldinteriorid)
{
    return 
1;

i just tryed the team setup and fail this is the errors i get:

Code:
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\pawno\army.pwn(36) : error 029: invalid expression, assumed zero
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\pawno\army.pwn(40) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
DaRkAnGeL[NBK] is offline   Reply With Quote
Old 07/10/2011, 08:20 PM   #5
DreamOnIt
Big Clucker
 
Join Date: Oct 2011
Posts: 70
Reputation: 2
Default Re: [HELP] Need Someone To Build My Filterscript

Quote:
Originally Posted by DaRkAnGeL[NBK] View Post
PHP Code:
/* Army VS Terriost simple TDM filterscript which consists of two teams Army And Terriosts army are green terriosts red
the objective is simple capture the other teams money bag and take it to your base i dont mind you using this
filterscript but you must keep all credits */
#define FILTERSCRIPT

#include <a_samp>

//defines for the teams

#define TEAM_ARMY
#define TEAM_TERRORIST
#define COLOR_TERRORIST 0xB30404FF
#define COLOR_ARMY 0x005701FF
new gTeam[MAX_PLAYERS];

public 
OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Army Vs Terriosts");
    print(
"--------------------------------------\n");
    return 
1;
}

public 
OnFilterScriptExit()
{
    return 
1;
}

public 
OnPlayerSpawn(playerid)
{
    
SetPlayerToTeamColor(playerid);
    return 
1;
}
SetPlayerToTeamColor(playerid)
{
    if (
gTeam[playerid] == TEAM_ARMY)
    {
        
SetPlayerColor(playeridCOLOR_ARMY);
    }
    else if (
gTeam[playerid] == TEAM_TERRORIST)
    {
        
SetPlayerColor(playeridCOLOR_TERRORIST);
    }
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    return 
1;
}

public 
OnVehicleSpawn(vehicleid)
{
    return 
1;
}

public 
OnVehicleDeath(vehicleidkillerid)
{
    return 
1;
}

public 
OnPlayerText(playeridtext[])
{
    return 
1;
}

public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/mycommand"cmdtexttrue10) == 0)
    {
        
// Do something here
        
return 1;
    }
    return 
0;
}

public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    return 
1;
}

public 
OnPlayerExitVehicle(playeridvehicleid)
{
    return 
1;
}

public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    return 
1;
}

public 
OnPlayerEnterCheckpoint(playerid)
{
    return 
1;
}

public 
OnPlayerLeaveCheckpoint(playerid)
{
    return 
1;
}

public 
OnPlayerEnterRaceCheckpoint(playerid)
{
    return 
1;
}

public 
OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 
1;
}

public 
OnRconCommand(cmd[])
{
    return 
1;
}

public 
OnPlayerRequestSpawn(playerid)
{
    return 
1;
}

public 
OnObjectMoved(objectid)
{
    return 
1;
}

public 
OnPlayerObjectMoved(playeridobjectid)
{
    return 
1;
}

public 
OnPlayerPickUpPickup(playeridpickupid)
{
    return 
1;
}

public 
OnPlayerSelectedMenuRow(playeridrow)
{
    return 
1;
}

public 
OnPlayerInteriorChange(playeridnewinterioridoldinteriorid)
{
    return 
1;

i just tryed the team setup and fail this is the errors i get:

Code:
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\pawno\army.pwn(36) : error 029: invalid expression, assumed zero
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\pawno\army.pwn(40) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

pawn Code:
#define TEAM_ARMY
#define TEAM_TERRORIST

You don't say to the preprocessor what it should replace those defines with...
DreamOnIt is offline   Reply With Quote
Old 07/10/2011, 08:24 PM   #6
DaRkAnGeL[NBK]
Huge Clucker
 
DaRkAnGeL[NBK]'s Avatar
 
Join Date: Sep 2011
Location: Nottingham
Posts: 273
Reputation: 2
Default Re: [HELP] Need Someone To Build My Filterscript

sorry i dont understand
DaRkAnGeL[NBK] is offline   Reply With Quote
Old 07/10/2011, 08:28 PM   #7
DreamOnIt
Big Clucker
 
Join Date: Oct 2011
Posts: 70
Reputation: 2
Default Re: [HELP] Need Someone To Build My Filterscript

Quote:
Originally Posted by DaRkAnGeL[NBK] View Post
sorry i dont understand
#define tell the preprocessor to replace a certain value/text with what you defined (if i can say it that way)

for example:

pawn Code:
#define NUMBER_ONE 1

So now, with that define, you can just write NUMBER_ONE in your code to refer to number 1:

pawn Code:
if(PlayerInfo[playerid][pAdmin] < NUMBER_ONE) return SendClientMessage(playerid,COLOR_RED,"You are not an admin.");


Got it?
DreamOnIt is offline   Reply With Quote
Old 07/10/2011, 08:29 PM   #8
Ensconce
Big Clucker
 
Join Date: Apr 2011
Posts: 58
Reputation: 7
Default Re: [HELP] Need Someone To Build My Filterscript

Please learn some basic pawn, or basic scripting in any language. Then you will understand.

What #define does is look through your script for TEAM_ARMY and replace it with whatever you asked it to replace it with during pre-compilation.

So you need to actually state what to replace TEAM_ARMY and TEAM_TERRORIST with.

#define TEAM_ARMY 1
#define TEAM_TERRORIST 2
Ensconce is offline   Reply With Quote
Old 07/10/2011, 08:31 PM   #9
Naruto_Emilio
Banned
 
Join Date: Apr 2011
Location: North Africa
Posts: 1,297
Reputation: 365
Default Re : [HELP] Need Someone To Build My Filterscript

nvm...i mistyped something wrong...
Naruto_Emilio is offline   Reply With Quote
Old 07/10/2011, 08:44 PM   #10
DreamOnIt
Big Clucker
 
Join Date: Oct 2011
Posts: 70
Reputation: 2
Default Re: Re : [HELP] Need Someone To Build My Filterscript

Quote:
Originally Posted by Naruto_Emilio View Post
pawn Code:
SetPlayerToTeamColor(playerid)
{
    if (gTeam[playerid] = TEAM_ARMY)
    {
        SetPlayerColor(playerid, COLOR_ARMY);
    }
    else if (gTeam[playerid] = TEAM_TERRORIST)
    {
        SetPlayerColor(playerid, COLOR_TERRORIST);
    }
}
That is even worst.... please read a tutorial on control structures
DreamOnIt is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any one wants to me to build or script for him? Deathtitan778 General 4 02/09/2011 10:05 PM
0.3C Build! -Rebel Son- Help Archive 2 04/12/2010 09:39 AM
How to build second log billy4601 Help Archive 5 11/05/2010 03:13 PM
Help me build this? -Rebel Son- Help Archive 6 06/05/2010 10:54 PM
[FilterScript] [FS] Shitbird Administration Filterscript. (Build/Version 2) shitbird Filterscripts 13 27/11/2009 05:04 PM


All times are GMT. The time now is 12:08 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.