SA-MP Forums Archive
Need Help with dcmd_setteam - 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)
+--- Thread: Need Help with dcmd_setteam (/showthread.php?tid=347244)



Need Help with dcmd_setteam - Devilxz97 - 01.06.2012

hey anyone can help me? i need this commands its like this . .
example : /setteam [playerid/PartOfName] [TeamID]

and only admin level 6 can set the player . . Help +Rep


Re: Need Help with dcmd_setteam - juraska - 01.06.2012

Код:
dcmd_setteam(playerid, params[])
{
     new pID, tID;
     if(sscanf(params,"rd",pID, tID)) return SendClientMessage(playerid,-1,"/setteam [playerid/PartOfName] [TeamID] ");
     yourteamvariable[pID] = tID;
     return 1;
}



Re: Need Help with dcmd_setteam - mickos - 01.06.2012

Yea what juraska says works I think so.


Re: Need Help with dcmd_setteam - JaKe Elite - 01.06.2012

don't forget to add

pawn Код:
dcmd(setteam, 7, cmdtext);
OnPlayerCommandText


Re: Need Help with dcmd_setteam - pasha97 - 01.06.2012

i don't see nay use of dcmd. Better use:

Код:
CMD:setteam



Re: Need Help with dcmd_setteam - JaKe Elite - 01.06.2012

dcmd use

dcmd_commandname not CMD:commandname

CMD:commandname is only use to zcmd not to dcmd


Re: Need Help with dcmd_setteam - Devilxz97 - 01.06.2012

my teleport wont works when im using zcmd and sscanf2 include idk why . :\
that's why im using dcmd

@juraska let me try okay


Re: Need Help with dcmd_setteam - Devilxz97 - 01.06.2012

Код:
C:\Users\user\Desktop\SAMP server 0.3e\gamemodes\DriftVision.pwn(1383) : warning 217: loose indentation
C:\Users\user\Desktop\SAMP server 0.3e\gamemodes\DriftVision.pwn(1409) : warning 217: loose indentation
C:\Users\user\Desktop\SAMP server 0.3e\gamemodes\DriftVision.pwn(1429) : error 017: undefined symbol "yourteamvariable"
C:\Users\user\Desktop\SAMP server 0.3e\gamemodes\DriftVision.pwn(1429) : warning 215: expression has no effect
C:\Users\user\Desktop\SAMP server 0.3e\gamemodes\DriftVision.pwn(1429) : error 001: expected token: ";", but found "]"
C:\Users\user\Desktop\SAMP server 0.3e\gamemodes\DriftVision.pwn(1429) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\SAMP server 0.3e\gamemodes\DriftVision.pwn(1429) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
yourteamvariables ?
ur means ? the TEAM? lolz ima not so good in scripting im just good at dialog lolz


Re: Need Help with dcmd_setteam - iJumbo - 01.06.2012

you mean https://sampwiki.blast.hk/wiki/SetPlayerTeam ?


Re: Need Help with dcmd_setteam - juraska - 01.06.2012

Ahh, I thought you doing custom script.
Then:
Код:
dcmd_setteam(playerid, params[])
{
     new pID, tID;
     if(sscanf(params,"rd",pID, tID)) return SendClientMessage(playerid,-1,"/setteam [playerid/PartOfName] [TeamID] ");
     SetPlayerTeam(pID, tID);
     return 1;
}



Re: Need Help with dcmd_setteam - Devilxz97 - 01.06.2012

okay let me try first


Re: Need Help with dcmd_setteam - Devilxz97 - 01.06.2012

can add this to ?
Код:
  	new name[MAX_PLAYER_NAME], string[256];
    GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "|-> {FF0000}%s {FFFFFF}is now in {FFFF00}World Mode 3 {FFFFFF}<-|",name);
	SendClientMessageToAll(COLOR_WHITE, string);
to the script ? when someone get promote to join some team all player will see it


Re: Need Help with dcmd_setteam - iJumbo - 01.06.2012

Yes but you can define some "modes" and associate it to a team id..


Re: Need Help with dcmd_setteam - juraska - 01.06.2012

yes you can.


Re: Need Help with dcmd_setteam - Devilxz97 - 01.06.2012

this is my team ID

//top of script
#define NORMAL_PLAYER 0
#define TEAM_COPS 1

when i do in game

/setteam 1 1

nothing happen


Re: Need Help with dcmd_setteam - Horrible - 01.06.2012

Quote:
Originally Posted by Devilxz97
Посмотреть сообщение
this is my team ID

//top of script
#define NORMAL_PLAYER 0
#define TEAM_COPS 1

when i do in game

/setteam 1 1

nothing happen
what do you mean ?
setplayerteam is for player team not classid

so when setplayerteam to 123
other person with team 123 cant kill him


Re: Need Help with dcmd_setteam - Sandiel - 01.06.2012

Sorry, I don't use DCMD, I use ZCMD, but should be the same concept...
Код:
COMMAND:setteam(playerid, params[])
{
     if(PlayerInfo[playerid][pAdmin] >= 3) // dunno your admin enums? or your admin levels too....so yeh
     {
         new targetID, teamid;
         if(!sscanf(params, "ui", targetid, teamid))
         {
               PlayerInfo[playerid][pTeam] = teamid; // dunno your team variables, so change it to yours...
               SendClientMessage(playerid, COLOR_WHITE, "That player's team was set.");
               SendClientMessage(playerid, COLOR_WHITE, "Your team was set by an administrator.");
         }
     }
     return 1;
}



Re: Need Help with dcmd_setteam - Devilxz97 - 01.06.2012

Quote:
Originally Posted by Sandiel
Посмотреть сообщение
Sorry, I don't use DCMD, I use ZCMD, but should be the same concept...
Код:
COMMAND:setteam(playerid, params[])
{
     if(PlayerInfo[playerid][pAdmin] >= 3) // dunno your admin enums? or your admin levels too....so yeh
     {
         new targetID, teamid;
         if(!sscanf(params, "ui", targetid, teamid))
         {
               PlayerInfo[playerid][pTeam] = teamid; // dunno your team variables, so change it to yours...
               SendClientMessage(playerid, COLOR_WHITE, "That player's team was set.");
               SendClientMessage(playerid, COLOR_WHITE, "Your team was set by an administrator.");
         }
     }
     return 1;
}
when im using sscanf and zcmd my teleport wont works idk why ? hmm