11.01.2019, 16:45
Hi!
I'm working on a server which has 2 teams and I want to make the /changeteam command.
I am new in scripting, so please explain me if you can.
I tried to make something like this:
SetPlayerTeamFromClass:
Thanks!
I'm working on a server which has 2 teams and I want to make the /changeteam command.
I am new in scripting, so please explain me if you can.
I tried to make something like this:
Код:
CMD:changeteam(playerid, params[]) { SetPlayerTeamFromClass(playerid, classid); return 1; }
Код:
forward SetPlayerTeamFromClass(playerid, classid); public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid, classid); return 1; } public SetPlayerTeamFromClass(playerid, classid) { if(classid == 0 || classid == 1 || classid == 2 || classid == 3) { gTeam[playerid] = COPS; GameTextForPlayer(playerid,"~b~COPS",3000,5); SetPlayerPos(playerid,1975.2399,-1220.0157,25.0779); SetPlayerCameraPos(playerid,1969.5686,-1224.0016,24.9909); SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779); SetPlayerFacingAngle(playerid,122.4500); SetPlayerColor(playerid,0xA000FFFF); } else if(classid == 4 || classid == 5 || classid == 6 || classid == 7) { gTeam[playerid] = ROBBERS; GameTextForPlayer(playerid,"~r~ROBBERS",3000,5); SetPlayerPos(playerid,2500.6060,-1672.1453,13.3512); SetPlayerCameraPos(playerid,2507.0615,-1674.3574,13.3732); SetPlayerCameraLookAt(playerid,2500.6060,-1672.1453,13.3512); SetPlayerFacingAngle(playerid,252.4717); SetPlayerColor(playerid,0x55FF00FF); } }