06.08.2010, 09:41
So here we are.
I would like to know how to create team properly. I tried but it has no effect.(There is no error but there are warnings )
Here is my script:
I would like to know how to create team properly. I tried but it has no effect.(There is no error but there are warnings )
Here is my script:
Код:
//-----------------------------[Cstrike 1.6]----------------------------------// #include <a_samp> #include <core> #include <float> //----------------------------------------------------------------------------// new Menu:select1; new Menu:selectteam1; new Menu:selectteam2; //----------------------------------------------------------------------------// new gTeam[MAX_PLAYERS]; //----------------------------------------------------------------------------// #define TEAM_RED 1 #define TEAM_BLUE 2 #define TEAM_RED_COLOR #800517 #define TEAM_BLUE_COLOR #1569c7 #if defined FILTERSCRIPT //----------------------------------------------------------------------------// public OnFilterScriptInit() { return 1; } //----------------------------------------------------------------------------// public OnFilterScriptExit() { return 1; } #else main() { print("\n----------------------------------"); print(" Gamemode By Vakho"); print("----------------------------------\n"); } #endif //----------------------------------------------------------------------------// public OnGameModeInit() { SetGameModeText("Couter-Strike"); DisableInteriorEnterExits(); AllowInteriorWeapons(1); ShowPlayerMarkers(2); ShowNameTags(1); //////////////////////////////////////////////////////////////////////////////// select1 = CreateMenu("Select Team:", 1, 50.0, 180.0, 200.0, 200.0); AddMenuItem(select1, 0, "1. Terrorist Forces"); AddMenuItem(select1, 0, "2. CT Forces"); //////////////////////////////////////////////////////////////////////////////// selectteam1 = CreateMenu("Select Player:", 1, 50.0, 180.0, 200.0, 200.0); AddMenuItem(selectteam1, 0, "1. Phoenix Connecion"); AddMenuItem(selectteam1, 0, "2. L337 Krew"); AddMenuItem(selectteam1, 0, "3. Arctic Avengers"); AddMenuItem(selectteam1, 0, "4. Guerilla Warfare"); AddMenuItem(selectteam1, 0, "< Back"); //////////////////////////////////////////////////////////////////////////////// selectteam2 = CreateMenu("Select Player:", 1, 50.0, 180.0, 200.0, 200.0); AddMenuItem(selectteam2, 0, "1. Seal Team 6"); AddMenuItem(selectteam2, 0, "2. GSG-9"); AddMenuItem(selectteam2, 0, "3. SAS"); AddMenuItem(selectteam2, 0, "4. GIGN"); AddMenuItem(selectteam2, 0, "< Back"); //////////////////////////////////////////////////////////////////////////////// return 1; } //----------------------------------------------------------------------------// public OnGameModeExit() { return 1; } //----------------------------------------------------------------------------// public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid, classid); return 1; } //----------------------------------------------------------------------------// public OnPlayerConnect(playerid) { TogglePlayerSpectating(playerid, 1); ShowMenuForPlayer(select1, playerid); return 1; } //----------------------------------------------------------------------------// public OnPlayerDisconnect(playerid, reason) { return 1; } //----------------------------------------------------------------------------// public OnPlayerSpawn(playerid) { TogglePlayerSpectating(playerid, 0); GivePlayerMoney(playerid, 100); return 1; } //----------------------------------------------------------------------------// public OnPlayerDeath(playerid, killerid, reason) { TogglePlayerSpectating(playerid, 1); PlayerSpectatePlayer(playerid, killerid); return 1; } //----------------------------------------------------------------------------// public OnVehicleSpawn(vehicleid) { return 1; } //----------------------------------------------------------------------------// public OnVehicleDeath(vehicleid, killerid) { return 1; } //----------------------------------------------------------------------------// public OnPlayerText(playerid, text[]) { return 1; } //----------------------------------------------------------------------------// public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/kill", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid,0); return 1; } return 0; } //----------------------------------------------------------------------------// public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } //----------------------------------------------------------------------------// public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } //----------------------------------------------------------------------------// public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; } //----------------------------------------------------------------------------// public OnPlayerEnterCheckpoint(playerid) { return 1; } //----------------------------------------------------------------------------// public OnPlayerLeaveCheckpoint(playerid) { return 1; } //----------------------------------------------------------------------------// public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } //----------------------------------------------------------------------------// public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } //----------------------------------------------------------------------------// public OnRconCommand(cmd[]) { return 1; } //----------------------------------------------------------------------------// public OnPlayerRequestSpawn(playerid) { return 1; } //----------------------------------------------------------------------------// public OnObjectMoved(objectid) { return 1; } //----------------------------------------------------------------------------// public OnPlayerObjectMoved(playerid, objectid) { return 1; } //----------------------------------------------------------------------------// public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } //----------------------------------------------------------------------------// public OnVehicleMod(playerid, vehicleid, componentid) { return 1; } //----------------------------------------------------------------------------// public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { return 1; } //----------------------------------------------------------------------------// public OnVehicleRespray(playerid, vehicleid, color1, color2) { return 1; } //----------------------------------------------------------------------------// public OnPlayerSelectedMenuRow(playerid, row) { new Menu:current; current = GetPlayerMenu(playerid); if(current == select1) { switch(row) { case 0:{ ShowMenuForPlayer(selectteam1, playerid); } case 1:{ ShowMenuForPlayer(selectteam2, playerid); } } } else if(current == selectteam1) { switch(row) { case 0:{ SetSpawnInfo(playerid,1,144,2226.7431640625,-1149.7001953125,1025.796875,181.3925,0,0,22,0,0,0); SetCameraBehindPlayer(playerid); SetPlayerInterior(playerid, 15); SetPlayerFacingAngle( playerid, 0 ); TogglePlayerSpectating(playerid, 0); SpawnPlayer(playerid);//1. Phoenix Connecion } case 1:{ SetSpawnInfo(playerid,1,73,2223.0927734375,-1153.2939453125,1025.796875,181.3925,0,0,22,0,0,0); SetCameraBehindPlayer(playerid); SetPlayerInterior(playerid, 15); SetPlayerFacingAngle( playerid, 0 ); TogglePlayerSpectating(playerid, 0); SpawnPlayer(playerid);//2. L337 Krew } case 2:{ SetSpawnInfo(playerid,1,29,2221.302734375,-1153.3310546875,1025.796875,181.3925,0,0,22,0,0,0); SetCameraBehindPlayer(playerid); SetPlayerInterior(playerid, 15); SetPlayerFacingAngle( playerid, 0 ); TogglePlayerSpectating(playerid, 0); SpawnPlayer(playerid);//3. Arctic Avengers } case 3:{ SetSpawnInfo(playerid,1,100,2219.671875,-1153.2421875,1025.796875,181.3925,0,0,22,0,0,0); SetCameraBehindPlayer(playerid); SetPlayerInterior(playerid, 15); SetPlayerFacingAngle( playerid, 0 ); TogglePlayerSpectating(playerid, 0); SpawnPlayer(playerid);//4. Guerilla Warfare } case 4:{ ShowMenuForPlayer(select1, playerid); } } } else if(current == selectteam2) { switch(row) { case 0:{ SetSpawnInfo(playerid,1,285,2192.1123046875,-1140.0244140625,1029.796875,181.3925,0,0,22,0,0,0); SetCameraBehindPlayer(playerid); SetPlayerInterior(playerid, 15); SetPlayerFacingAngle( playerid, 180 ); TogglePlayerSpectating(playerid, 0); SpawnPlayer(playerid);//1. Seal Team 6 } case 1:{ SetSpawnInfo(playerid,1,285,2194.3779296875,-1140.0185546875,1029.796875,181.3925,0,0,22,0,0,0); SetCameraBehindPlayer(playerid); SetPlayerInterior(playerid, 15); SetPlayerFacingAngle( playerid, 180 ); TogglePlayerSpectating(playerid, 0); SpawnPlayer(playerid);//2. GSG-9 } case 2:{ SetSpawnInfo(playerid,1,285,2196.48828125,-1139.9111328125,1029.796875,181.3925,0,0,22,0,0,0); SetCameraBehindPlayer(playerid); SetPlayerInterior(playerid, 15); SetPlayerFacingAngle( playerid, 180 ); TogglePlayerSpectating(playerid, 0); SpawnPlayer(playerid);//3. SAS } case 3:{ SetSpawnInfo(playerid,1,285,2198.4150390625,-1139.8759765625,1029.796875,181.3925,0,0,22,0,0,0); SetCameraBehindPlayer(playerid); SetPlayerInterior(playerid, 15); SetPlayerFacingAngle( playerid, 180 ); TogglePlayerSpectating(playerid, 0); SpawnPlayer(playerid);//4. GIGN } case 4:{ ShowMenuForPlayer(select1, playerid); } } } return 1; } //----------------------------------------------------------------------------// public OnPlayerExitedMenu(playerid) { return 1; } //----------------------------------------------------------------------------// public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { return 1; } //----------------------------------------------------------------------------// public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } //----------------------------------------------------------------------------// public OnRconLoginAttempt(ip[], password[], success) { return 1; } //----------------------------------------------------------------------------// public OnPlayerUpdate(playerid) { return 1; } //----------------------------------------------------------------------------// public OnPlayerStreamIn(playerid, forplayerid) { return 1; } //----------------------------------------------------------------------------// public OnPlayerStreamOut(playerid, forplayerid) { return 1; } //----------------------------------------------------------------------------// public OnVehicleStreamIn(vehicleid, forplayerid) { return 1; } //----------------------------------------------------------------------------// public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } //----------------------------------------------------------------------------// public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { return 1; } //----------------------------------------------------------------------------// public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } //////////////////////////////////////////////////////////////////////////////// SetPlayerTeamFromClass(playerid, classid) { if (classid == 0) { gTeam[playerid] = TEAM_RED; } else { gTeam[playerid] = TEAM_BLUE; } } //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////