Lots of help needed here..! -
Moustafa - 27.06.2009
Hello guys, i've just searched for Teams for special skins, and i think i made it, well, i hope it is right too.. actually..,
Anyways here is what i found to make a team to a skin:
#defines and other stuffs:
pawn Код:
#define TEAM_DMV 1
new gteam[MAX_PLAYERS];
The team thingy.. i think:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
switch (59) {
case 0:
{
gteam[playerid] = TEAM_DMV;
}
}
return 1;
}
Well after that thingy, i want to make a special command for this team only can be used by them, and it is /d(mv)c(hat) - /dc, or /dmvchat, and they use it for a private team chat, and..
I want to make only 4 special cars that only them who can enter it, if any other player, it kicks him out of the car, or it is locked for him..,
The 4 special cars ID is 405
Well, i think thats all for now! ^_^
Re: Lots of help needed here..! -
Moustafa - 27.06.2009
Noone is answering ? why?? its hard ??
Re: Lots of help needed here..! -
AiVAMAN - 27.06.2009
I didn't understand you very well... sorry.
Re: Lots of help needed here..! -
Moustafa - 27.06.2009
I mean i want to SET A COMMAND FOR THE TEAM_DMV ONLY, Only that team who can use it, anyone else can't!!
And i want to make some vehicles only the TEAM_DMV can enter it, others not... got it now?
Re: Lots of help needed here..! -
Moustafa - 27.06.2009
You still dont get it? -.-
Re: Lots of help needed here..! -
arnutisz - 27.06.2009
At the top of your command:
Код:
if(gteam[playerid] != TEAM_DMW) return SendClientMessage(playerid, color, "you not in team dmw"):
Re: Lots of help needed here..! -
member - 27.06.2009
Here you go in it's simplist form:
-For the vehicle:
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
new carid;
carid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
if(carid == 405 && gteam[playerid] != TEAM_DMV) // 405 is the carid
{
SendClientMessage(playerid, 0xFF0000AA, "You cannot use this Vehicle - Ejected");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
That will kick all NON TEAM_DMV players entering vehcile model 405 entering that vehicle
-And for the command:
pawn Код:
if(!strcmp(cmdtext,"/test",true,5))
{
if(gteam[playerid] != TEAM_DMV) return SendClientMessage(playerid, AAD_COLOR_RED, "You Must be a DMV to use that Command!"); // this is the important Line!
PlayerPlaySound(playerid, 1055, 0.0, 0.0, 0.0);
//Your Code here for this command...
return 1;
}
That will stop all NON TEAM_DMV players using the /test command. ( I added an appropriate sound to it as well :P)
This is
Untested.
Re: Lots of help needed here..! -
Moustafa - 27.06.2009
I want the command to be a private chat for the team, for example:
/dmvchat or /dc:
/dc Hello
* * (DMV Chat:: Moustafa says: Hello. ) * *
i want it with both commands, /dmvchat and /dc ..also to add automatic DOT after the text, as you see its "Hello." and after it a space and bracket " )"
Hope you know what i mean.
Re: Lots of help needed here..! -
member - 27.06.2009
that's more of a script request. Anyways, since i am bored, i quickly searched and changed some bit. Not sure if it works. Let me know if it does or doesn't:
-Command:
pawn Код:
if(strcmp(cmd, "/dmvchat", true) == 0 || strcmp(cmd, "/dc", true) == 0)
{
if (gTeam[playerid] == TEAM_DMV)
{
if ((strlen(cmdtext) > 4)&&(strlen(cmdtext) <= 50))
{
new message[50], name[MAX_PLAYERS];
strmid(message,cmdtext,4,strlen(cmdtext));
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"-> (DMV Radio(%s): %s .)",name,message);
SendDMVMessage(TEAM_DMV,0xFFFF00AA, string);
return 1;
}
else return SendClientMessage(playerid, 0xFFFF00AA, "-> You mean: /dc [Message]");
}
else return SendClientMessage(playerid, 0xFFFF00AA, "-> You are not a DMV!");
}
-Function
pawn Код:
SendDMVMessage(color, text[])
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if (gTeam[i] == TEAM_DMV)
{
SendClientMessage(i, color, text);
}
}
}
return 1;
}