3 questions. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 3 questions. (
/showthread.php?tid=66428)
3 questions. -
Dragonite - 22.02.2009
Question 1 : How to script gang chat's ?
Question 2 :How to get a login for your gang*
Question 3 :how to get your gang to pay you every now and then ?
my mistake.
Re: 3 questions. -
JaYmE - 22.02.2009
Answer 1: Use OnPlayerText(playerid, text[]) {} to find out if the first character is ! or @ or whatever you want the team chat character to be and if !/@ == true just send the text to that team

wiki.sa-mp.com can hep with setting up teams
Answer 2 - 3: (these are the same question) just use a timer and when the timer is 0 just take the ammount of money of them and give it to you, keep in mind that each player on your team will cost 100$ (example) you will need a array to find out there teams.
Good luck
Re: 3 questions. -
harly - 22.02.2009
Uhm,i have the same question,
i need sombody to tell me where to put the chat ect
like lay it down for me D:,
www.confused.com
Re: 3 questions. -
Dragonite - 22.02.2009
sorry my mistake question 2 changed.
can you like send me part of the code for the gang chat please ?
and the money system it's for a RP server and how i make /login for a gang ?
Re: 3 questions. -
harly - 22.02.2009
Код:
Public OnPlayerCommandText(playerid, cmdtext)
{
if (strcmp("/cop *password*", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,248.5653,67.3170,1003.6406);
SetPlayerColor(playerid, 0x0000BBAA);
SetPlayerInterior(playerid, 6);
SetPlayerSkin(playerid, 280);
GivePlayerWeapon(playerid, 3, 1);
GivePlayerWeapon(playerid, 24,500);
GivePlayerWeapon(playerid, 41,500);
GivePlayerMoney(playerid, 5000);
SendClientMessage (playerid, 0x33AA33AA, "You are now a cop");
new pName[MAX_PLAYER_NAME];
new string[48];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "%s is now a cop, watch out!.", pName);
SendClientMessageToAll(0xAAAAAAAA, string);
// Do something here
return 1;
}
Co-Ords are for Dillamore PD. Man i have same question for 1 and 3
Re: 3 questions. -
Backwardsman97 - 22.02.2009
Quote:
Originally Posted by Dragonite
sorry my mistake question 2 changed.
can you like send me part of the code for the gang chat please ?
and the money system it's for a RP server and how i make /login for a gang ?
|
Look into dudb for the login.
pawn Код:
public OnPlayerText(playerid,text[])
{
if(!strcmp(text[0],"!",true))//They typed ! as the first character (you can easily change it to whatever)
{
new TeamChat[128];
format(TeamChat,sizeof(TeamChat),"TEAM CHAT: %s(%d) : %s",ReturnPlayerName(playerid),playerid,text);//Format the message to be sent
//Idk if you are using gTeam or the native team functions so I will show both
//Native team function
new team = GetPlayerTeam(playerid);
for(new i =0; i<MAX_PLAYERS; i++)
{
if(GetPlayerTeam(i) == team)
{
SendClientMessage(i,COLOR,TeamChat);
}
}
//gTeam way
for(new i =0; i<MAX_PLAYERS; i++)
{
if(GetPlayerTeam(i) == gTeam[playerid])
{
SendClientMessage(i,COLOR,TeamChat);
}
}
//Just erase the one you're not using.
}
}
Idk if that will work. You can try it.
Re: 3 questions. -
Dragonite - 22.02.2009
Where can i find a tutorial for stuf like this ?
Re: 3 questions. -
JaYmE - 22.02.2009
wiki.sa-mp.com
Good Luck