SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 07/06/2009, 06:53 PM   #1
Pawno_Master
Huge Clucker
 
Join Date: Jun 2009
Posts: 379
Reputation: 0
Default Ballas v.s Grove problem

Hi everyone
Srry for my last topics but a friend of mine get's a little angry most of the time xD
but i have a problem with mij Grove/Ballas server

Code:
#define TEAM_GROVE 1
#define TEAM_BALLA 2
#define TEAM_GROVE_COLOR 0x00FF00AA // Bright Green (in RGBA format)
#define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple
new gTeam[MAX_PLAYERS];
SetPlayerTeamFromClass(playerid, classid)
{
	if (classid == 0)
	{
		gTeam[playerid] = TEAM_GROVE;
	}
	else
	{
		gTeam[playerid] = TEAM_BALLA;
	}
}
SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_GROVE)
	{
		SetPlayerColor(playerid, TEAM_GROVE_COLOR);
	}
	else if (gTeam[playerid] == TEAM_BALLA)
	{
		SetPlayerColor(playerid, TEAM_BALLA_COLOR);
	}
}
That is my grove/ballas pawno script i get this warning
Code:
C:\Gta sa server\gamemodes\BallasGrove.pwn(208) : warning 203: symbol is never used: "SetPlayerTeamFromClass"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
And the script doesn't work does anyone nows what the problem is?
Pawno_Master is offline  
Old 07/06/2009, 07:08 PM   #2
Luka P.
High-roller
 
Join Date: Feb 2009
Posts: 1,428
Reputation: 13
Default Re: Ballas v.s Grove problem

Warning comes because you never used SetPlayerTeamFromClass
To warning dissapper just use it anywhere in script.
Luka P. is offline  
Old 07/06/2009, 07:15 PM   #3
Pawno_Master
Huge Clucker
 
Join Date: Jun 2009
Posts: 379
Reputation: 0
Default Re: Ballas v.s Grove problem

Does it work than?
Pawno_Master is offline  
Old 07/06/2009, 07:17 PM   #4
Luka P.
High-roller
 
Join Date: Feb 2009
Posts: 1,428
Reputation: 13
Default Re: Ballas v.s Grove problem

No, this script will not going to work.
Add this part

pawn Code:
public OnPlayerSpawn(playerid)
{
    SetPlayerTeamFromClass(playerid,classid);
    SetPlayerToTeamColor(playerid);
    return 1;
}
Luka P. is offline  
Old 07/06/2009, 07:31 PM   #5
Pawno_Master
Huge Clucker
 
Join Date: Jun 2009
Posts: 379
Reputation: 0
Default Re: Ballas v.s Grove problem

if i do that i get this error

Code:
C:\Gta sa server\gamemodes\BallasGrove.pwn(99) : error 017: undefined symbol "classid"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Pawno_Master is offline  
Old 07/06/2009, 07:38 PM   #6
Luka P.
High-roller
 
Join Date: Feb 2009
Posts: 1,428
Reputation: 13
Default Re: Ballas v.s Grove problem

Here`s the correct code:
pawn Code:
#define TEAM_GROVE 1
#define TEAM_BALLA 2
#define TEAM_GROVE_COLOR 0x00FF00AA // Bright Green (in RGBA format)
#define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple

new gTeam[MAX_PLAYERS];

SetPlayerTeamFromClass(playerid)
{
       new classid = GetPlayerSkin(playerid);

    if (classid == 0)
    {
        gTeam[playerid] = TEAM_GROVE;
    }
    else
    {
        gTeam[playerid] = TEAM_BALLA;
    }
       return 1;
}
SetPlayerToTeamColor(playerid)
{
    if (gTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerColor(playerid, TEAM_GROVE_COLOR);
    }
    else if (gTeam[playerid] == TEAM_BALLA)
    {
        SetPlayerColor(playerid, TEAM_BALLA_COLOR);
    }
       return 1;
}
public OnPlayerSpawn(playerid)
{
        SetPlayerTeamFromClass(playerid);
        SetPlayerToTeamColor(playerid);
        return 1;
}
Luka P. is offline  
Old 07/06/2009, 07:43 PM   #7
Pawno_Master
Huge Clucker
 
Join Date: Jun 2009
Posts: 379
Reputation: 0
Default Re: Ballas v.s Grove problem

ok i did that
now i get this three warnings

Code:
C:\Gta sa server\gamemodes\BallasGrove.pwn(14) : warning 217: loose indentation
C:\Gta sa server\gamemodes\BallasGrove.pwn(22) : warning 217: loose indentation
C:\Gta sa server\gamemodes\BallasGrove.pwn(34) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


3 Warnings.
this is my pawno file

Code:
#include <a_samp>

#define TEAM_GROVE 1
#define TEAM_BALLA 2
#define TEAM_GROVE_COLOR 0x00FF00AA // Bright Green (in RGBA format)
#define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple

new gTeam[MAX_PLAYERS];

SetPlayerTeamFromClass(playerid)
{
       new classid = GetPlayerSkin(playerid);

if (classid == 0)
{
gTeam[playerid] = TEAM_GROVE;
}
else
{
gTeam[playerid] = TEAM_BALLA;
}
       return 1;
}
SetPlayerToTeamColor(playerid)
{
if (gTeam[playerid] == TEAM_GROVE)
{
SetPlayerColor(playerid, TEAM_GROVE_COLOR);
}
else if (gTeam[playerid] == TEAM_BALLA)
{
SetPlayerColor(playerid, TEAM_BALLA_COLOR);
}
       return 1;
}
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("Ballas V.S Grove");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

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

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

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 OnPlayerPrivmsg(playerid, recieverid, text[])
{
	return 1;
}

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

public OnPlayerInfoChange(playerid)
{
	return 1;
}

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 OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}
Pawno_Master is offline  
Old 07/06/2009, 07:49 PM   #8
Luka P.
High-roller
 
Join Date: Feb 2009
Posts: 1,428
Reputation: 13
Default Re: Ballas v.s Grove problem

Just indent your code.
Luka P. is offline  
Old 07/06/2009, 07:56 PM   #9
Pawno_Master
Huge Clucker
 
Join Date: Jun 2009
Posts: 379
Reputation: 0
Default Re: Ballas v.s Grove problem

WELL IT WORKS THANK GOD
now i have 3 questions

1. it works only on CJ he will become green how can i let other classes get green and let them be member of the team

2.well in the script you have

Else

Balla..blabla

but i don't want people they not choose grove become purple how can i make balla purple grove green and normal players white?

3.How can i make commands for different teams??

Thanks xD

Pawno_Master is offline  
Old 07/06/2009, 07:58 PM   #10
samgreen
Big Clucker
 
Join Date: Jan 2008
Posts: 127
Reputation: 0
Default Re: Ballas v.s Grove problem

Code:
SetPlayerTeamFromClass(playerid)
{
  new classid = GetPlayerSkin(playerid);

  if (classid == 0) {
    gTeam[playerid] = TEAM_GROVE;
  } else {
    gTeam[playerid] = TEAM_BALLA;
  }

  return 1;
}

SetPlayerToTeamColor(playerid)
{
  if (gTeam[playerid] == TEAM_GROVE) {
    SetPlayerColor(playerid, TEAM_GROVE_COLOR);
  } else if (gTeam[playerid] == TEAM_BALLA) {
    SetPlayerColor(playerid, TEAM_BALLA_COLOR);
  }

  return 1;
}
The warnings have been fixed.
samgreen is offline  
 

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
[MAP GROVE STREET BAZE NEW PD NEW BALLAS BAZE AND NEW BURGER :D James_Bauer Filterscripts 3 03/11/2010 09:41 AM
[AJUDA] Quanto saio da Annu vo pra HQ Ballas! [Ips]Guh PortuguÍs/Portuguese 13 04/06/2010 05:34 AM
Ballas Hangout? JoeDaDude Help Archive 13 22/01/2010 11:32 PM
[GameMode] [GM] Grove vs Ballas for newbies Erkan Gamemode Scripts 16 11/12/2009 09:13 PM


All times are GMT. The time now is 12:27 PM.


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