SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 05/09/2012, 03:24 PM   #1
MerCy
Little Clucker
 
Join Date: Apr 2012
Posts: 35
Reputation: 1
Default plzzz help me D:

i have been trying to clour my team from long time saw lots of tut but its not helping me so i hope i can get help from here ...here are the codes its giving me no errors but tow warrnings ....its only colouring team grove skin like 1st skin will be green second will be purple 3rd blue and 4th lightblue as defined so i want my whole grove team to be green ...ballas purple cops blue and bikers lightblue plz help


Code:
// killer G_wars
// by- chinmay kawale
//#define FILTERSCRIPT

#include <a_samp>
//================team ids ===============//
#define TEAM_GROVE  0
#define TEAM_BALLAS 1
#define TEAM_COPS   2
#define TEAM_BIKERS 3

//=========colors===========================//
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_TAN 0xBDB76BAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_INVISWHITE 0xFFFFFF00
#define COLOR_DARKRED 0x660000AA


//=======TEAM COLORS=====================//
#define TEAM_GROVE_COLOUR 0x33AA33AA//green duh
#define TEAM_BALLAS_COLOUR 0x800080AA//purple duh
#define TEAM_COPS_COLOUR 0x0000BBAA//blue duh
#define TEAM_BIKERS_COLOUR 0x33CCFFAA//lightblue duh


#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

new gTeam[MAX_PLAYERS];

main()
{
	print("\n----------------------------------");
	print(" G_wars by CHINMAY KAWLE            ");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	SetGameModeText("G_wars");
	//====team GROVE=====//
    AddPlayerClassEx(0, 105,2526.2241,  -1677.2172, 19.9302,   88.9206,  24,100, 27,100, 18,5);//grove team
    AddPlayerClassEx(0, 106,2528.2917,  -1639.5443, 13.9165,   318.8067, 24,100, 27,100, 18,5);//grove team
    AddPlayerClassEx(0, 107,2489.9795,  -1646.4088, 14.0772,   175.2360, 24,100, 27,100, 18,5);//grove team
    AddPlayerClassEx(0, 195,2459.3452,  -1690.0566, 13.5463,   3.7993,   24,100, 27,100, 18,5);//grove team

    //============team BALLAS====//
    AddPlayerClassEx(1, 102,2149.3672,  -1669.5734, 15.0859,   38.4910,  24,100, 27,100, 18,5);//ballas team
    AddPlayerClassEx(1, 103,2139.7065,  -1685.7714, 15.0859,   326.5673, 24,100, 27,100, 18,5);//ballas team
    AddPlayerClassEx(1, 104,2153.1519,  -1700.3630, 15.0859,   182.9966, 24,100, 27,100, 18,5);//ballas team
    AddPlayerClassEx(1,  13,2134.7634,  -1710.9509, 15.0784,   82.8777,  24,100, 27,100, 18,5);//ballas team

	//===========team cops======//
	AddPlayerClassEx(2, 280,  1568.5359,-1692.8879,  5.8906,  183.4404,  24,100, 27,100, 16,5);//cops team
    AddPlayerClassEx(2, 281,  1585.2015,-1674.1957,  5.8924,  273.7021,  24,100, 27,100, 16,5);//cops team
    AddPlayerClassEx(2, 285,  1579.3569,-1634.7751,  13.5624, 84.3684,   24,100, 27,100, 16,5);//cops team
	AddPlayerClassEx(2, 287,  1552.7753,-1675.3826,  16.1953, 87.0097,   24,100, 27,100, 16,5);//cops team

	//============team BIKERS=====//
	AddPlayerClassEx(3, 181,  1763.6765,-1920.9557,   13.5745, 89.8497,  24,100, 27,100, 16,5 );//bikers team
    AddPlayerClassEx(3, 248,  1762.5662,-1931.7689,   13.5721, 357.7706, 24,100, 27,100, 16,5 );//bikers team
    AddPlayerClassEx(3, 254,  1763.6277,-1911.4078,   13.5698, 181.3230, 24,100, 27,100, 16,5);//bikers team
    AddPlayerClassEx(3, 201,  1755.6136,-1920.6588,   13.5724, 272.7963, 24,100, 27,100, 16,5);//bikers team

	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid); // calls the custom function
    return 1;
}

public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColour(playerid); // calls the custom function
    return 1;
}

SetPlayerTeamFromClass(playerid, classid)

{
    if(classid == 0)
    {
        gTeam[playerid] = TEAM_GROVE; // using the defines at the top
    }
    else if(classid == 1)
    {
        gTeam[playerid] = TEAM_BALLAS; // same ^^
    }
    else if(classid == 2)
    {
        gTeam[playerid] = TEAM_COPS; // same ^^
    }
    else if(classid == 3)
    {
        gTeam[playerid] = TEAM_BIKERS; // same ^^
    }
}

SetPlayerToTeamColour(playerid)
{
    if(gTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerColor(playerid,TEAM_GROVE_COLOUR); //green
    }
    else if(gTeam[playerid] == TEAM_BALLAS)
    {
        SetPlayerColor(playerid,TEAM_BALLAS_COLOUR); //purple
    }
    else if(gTeam[playerid] == TEAM_COPS)
    {
        SetPlayerColor(playerid,TEAM_COPS_COLOUR); //blue
    }
    else if(gTeam[playerid] == TEAM_BIKERS)
    {
        SetPlayerColor(playerid,TEAM_BIKERS_COLOUR); //lightblue
    }

}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	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(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
MerCy is offline   Reply With Quote
Old 05/09/2012, 06:49 PM   #2
MerCy
Little Clucker
 
Join Date: Apr 2012
Posts: 35
Reputation: 1
Default Re: plzzz help me D:

someone plz reply +1 rep for reply
MerCy is offline   Reply With Quote
Old 06/09/2012, 06:20 AM   #3
MerCy
Little Clucker
 
Join Date: Apr 2012
Posts: 35
Reputation: 1
Default Re: plzzz help me D:

bump .............................plz someone help damnit
MerCy is offline   Reply With Quote
Old 06/09/2012, 06:36 AM   #4
airplanesimen
Huge Clucker
 
airplanesimen's Avatar
 
Join Date: Nov 2011
Location: Norway, Tromso
Posts: 405
Reputation: 19
Default Re: plzzz help me D:

It can be smart to explain in detail what you want, and remember to use punctuation when you write on forums.

I didnt understand anything of that you wrote in your first post.
__________________
Scripting
airplanesimen is offline   Reply With Quote
Old 06/09/2012, 07:34 AM   #5
MerCy
Little Clucker
 
Join Date: Apr 2012
Posts: 35
Reputation: 1
Default Re: plzzz help me D:

Quote:
Originally Posted by airplanesimen View Post
It can be smart to explain in detail what you want, and remember to use punctuation when you write on forums.

I didnt understand anything of that you wrote in your first post.

first of all thnx for the reply ..well yea my english is bad
i just want to colour my team thats it
like grove in green
ballas in purple
cops in blue
bikers in lightblue thats all ....

i saw the tutorial of it and did the exact same thing
made a variable new gTeam[MAX_PLAYERS]; and all but it only coloured some skins ....i want all my grove team in green ,ballas in purple ..........................

understood ?
MerCy is offline   Reply With Quote
Old 06/09/2012, 08:28 AM   #6
TaLhA XIV
Gangsta
 
TaLhA XIV's Avatar
 
Join Date: May 2012
Posts: 508
Reputation: 19
Default Re: plzzz help me D:

pawn Code:
public OnPlayerSpawn(playerid)
{
    if(classid == 0)
    {
        SetPlayerColor(playerid,0x33AA33AA);
    }
    else if(classid == 1)
    {
        SetPlayerColor(playerid,0x800080AA);
    }
    else if(classid == 2)
    {
        SetPlayerColor(playerid,0x0000BBAA);
    }
    else if(classid == 3)
    {
        SetPlayerColor(playerid,0x33CCFFAA);
    }
}
Use this and remove OnPlayerSpawn you already have and tell me if it works.
TaLhA XIV is offline   Reply With Quote
Old 06/09/2012, 09:04 AM   #7
MerCy
Little Clucker
 
Join Date: Apr 2012
Posts: 35
Reputation: 1
Default Re: plzzz help me D:

it says undefined symbol classid ....
do i have to remove gTeam[MAX_PLAYERS]; :/


Code:
C:\Users\Home\Desktop\0.3e\gamemodes\rated.pwn(96) : warning 217: loose indentation
C:\Users\Home\Desktop\0.3e\gamemodes\rated.pwn(101) : error 017: undefined symbol "classid"
C:\Users\Home\Desktop\0.3e\gamemodes\rated.pwn(105) : error 017: undefined symbol "classid"
C:\Users\Home\Desktop\0.3e\gamemodes\rated.pwn(109) : error 017: undefined symbol "classid"
C:\Users\Home\Desktop\0.3e\gamemodes\rated.pwn(113) : error 017: undefined symbol "classid"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase
MerCy is offline   Reply With Quote
Old 06/09/2012, 09:27 AM   #8
MarkoN
Big Clucker
 
MarkoN's Avatar
 
Join Date: May 2012
Posts: 174
Reputation: 24
Default Re: plzzz help me D:

Try it like this :
pawn Code:
public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == GROVE)
    {
        SetPlayerColor(playerid,0x33AA33AA);
    }
    else if(gTeam == TEAM_BALLAS)
    {
        SetPlayerColor(playerid,0x800080AA);
    }
    else if(gTeam == TEAM_COPS)
    {
        SetPlayerColor(playerid,0x0000BBAA);
    }
    else if(gTeam == TEAM_BIKERS)
    {
        SetPlayerColor(playerid,0x33CCFFAA);
    }
}
MarkoN is offline   Reply With Quote
Old 06/09/2012, 09:54 AM   #9
MerCy
Little Clucker
 
Join Date: Apr 2012
Posts: 35
Reputation: 1
Default Re: plzzz help me D:

error again
C:\Users\Home\Desktop\0.3e\gamemodes\rated.pwn(96) : warning 217: loose indentation
C:\Users\Home\Desktop\0.3e\gamemodes\rated.pwn(101 ) : error 017: undefined symbol "GROVE"
C:\Users\Home\Desktop\0.3e\gamemodes\rated.pwn(105 ) : error 033: array must be indexed (variable "gTeam")
C:\Users\Home\Desktop\0.3e\gamemodes\rated.pwn(109 ) : error 033: array must be indexed (variable "gTeam")
C:\Users\Home\Desktop\0.3e\gamemodes\rated.pwn(113 ) : error 033: array must be indexed (variable "gTeam")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


Code:
// killer G_wars
// by- chinmay kawale
//#define FILTERSCRIPT

#include <a_samp>
//================team ids ===============//
#define TEAM_GROVE  0
#define TEAM_BALLAS 1
#define TEAM_COPS   2
#define TEAM_BIKERS 3

//=========colors===========================//
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_TAN 0xBDB76BAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_INVISWHITE 0xFFFFFF00
#define COLOR_DARKRED 0x660000AA


//=======TEAM COLORS=====================//
#define TEAM_GROVE_COLOUR 0x33AA33AA//green duh
#define TEAM_BALLAS_COLOUR 0x800080AA//purple duh
#define TEAM_COPS_COLOUR 0x0000BBAA//blue duh
#define TEAM_BIKERS_COLOUR 0x33CCFFAA//lightblue duh


#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

new gTeam[MAX_PLAYERS];

main()
{
	print("\n----------------------------------");
	print(" G_wars by CHINMAY KAWLE            ");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	SetGameModeText("G_wars");
	//====team GROVE=====//
    AddPlayerClassEx(0, 105,2526.2241,  -1677.2172, 19.9302,   88.9206,  24,100, 27,100, 18,5);//grove team
    AddPlayerClassEx(0, 106,2528.2917,  -1639.5443, 13.9165,   318.8067, 24,100, 27,100, 18,5);//grove team
    AddPlayerClassEx(0, 107,2489.9795,  -1646.4088, 14.0772,   175.2360, 24,100, 27,100, 18,5);//grove team
    AddPlayerClassEx(0, 195,2459.3452,  -1690.0566, 13.5463,   3.7993,   24,100, 27,100, 18,5);//grove team

    //============team BALLAS====//
    AddPlayerClassEx(1, 102,2149.3672,  -1669.5734, 15.0859,   38.4910,  24,100, 27,100, 18,5);//ballas team
    AddPlayerClassEx(1, 103,2139.7065,  -1685.7714, 15.0859,   326.5673, 24,100, 27,100, 18,5);//ballas team
    AddPlayerClassEx(1, 104,2153.1519,  -1700.3630, 15.0859,   182.9966, 24,100, 27,100, 18,5);//ballas team
    AddPlayerClassEx(1,  13,2134.7634,  -1710.9509, 15.0784,   82.8777,  24,100, 27,100, 18,5);//ballas team

	//===========team cops======//
	AddPlayerClassEx(2, 280,  1568.5359,-1692.8879,  5.8906,  183.4404,  24,100, 27,100, 16,5);//cops team
    AddPlayerClassEx(2, 281,  1585.2015,-1674.1957,  5.8924,  273.7021,  24,100, 27,100, 16,5);//cops team
    AddPlayerClassEx(2, 285,  1579.3569,-1634.7751,  13.5624, 84.3684,   24,100, 27,100, 16,5);//cops team
	AddPlayerClassEx(2, 287,  1552.7753,-1675.3826,  16.1953, 87.0097,   24,100, 27,100, 16,5);//cops team

	//============team BIKERS=====//
	AddPlayerClassEx(3, 181,  1763.6765,-1920.9557,   13.5745, 89.8497,  24,100, 27,100, 16,5 );//bikers team
    AddPlayerClassEx(3, 248,  1762.5662,-1931.7689,   13.5721, 357.7706, 24,100, 27,100, 16,5 );//bikers team
    AddPlayerClassEx(3, 254,  1763.6277,-1911.4078,   13.5698, 181.3230, 24,100, 27,100, 16,5);//bikers team
    AddPlayerClassEx(3, 201,  1755.6136,-1920.6588,   13.5724, 272.7963, 24,100, 27,100, 16,5);//bikers team

	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid); // calls the custom function
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == GROVE)
    {
        SetPlayerColor(playerid,0x33AA33AA);
    }
    else if(gTeam == TEAM_BALLAS)
    {
        SetPlayerColor(playerid,0x800080AA);
    }
    else if(gTeam == TEAM_COPS)
    {
        SetPlayerColor(playerid,0x0000BBAA);
    }
    else if(gTeam == TEAM_BIKERS)
    {
        SetPlayerColor(playerid,0x33CCFFAA);
    }
}

SetPlayerTeamFromClass(playerid, classid)

{
    if(classid == 0)
    {
        gTeam[playerid] = TEAM_GROVE; // using the defines at the top
    }
    else if(classid == 1)
    {
        gTeam[playerid] = TEAM_BALLAS; // same ^^
    }
    else if(classid == 2)
    {
        gTeam[playerid] = TEAM_COPS; // same ^^
    }
    else if(classid == 3)
    {
        gTeam[playerid] = TEAM_BIKERS; // same ^^
    }
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	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 OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
MerCy is offline   Reply With Quote
Old 06/09/2012, 10:06 AM   #10
Gangster-rocks
Huge Clucker
 
Join Date: May 2012
Location: jordan
Posts: 415
Reputation: 25
Default Re: plzzz help me D:

ERRO i'll fix it
Gangster-rocks 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
help plzzz snabbo Help Archive 3 01/01/2010 02:15 PM
plzzz help me luckie12 Help Archive 2 29/04/2009 05:05 PM
need help i pay 30$ see plzzz Takuma Help Archive 7 15/03/2009 02:59 PM


All times are GMT. The time now is 01:23 PM.


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