Need Help with dcmd_setteam
#1

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
Reply
#2

Код:
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;
}
Reply
#3

Yea what juraska says works I think so.
Reply
#4

don't forget to add

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

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

Код:
CMD:setteam
Reply
#6

dcmd use

dcmd_commandname not CMD:commandname

CMD:commandname is only use to zcmd not to dcmd
Reply
#7

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

@juraska let me try okay
Reply
#8

Код:
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
Reply
#9

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

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;
}
Reply
#11

okay let me try first
Reply
#12

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
Reply
#13

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

yes you can.
Reply
#15

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
Reply
#16

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
Reply
#17

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;
}
Reply
#18

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)