public OnPlayerPlantBomb( playerid );public OnPlayerEnterCheckpoint( playerid ) { //Leelenorzöd, hogy a játékos csapata a zöld csapat-e if( GetPlayerTeam( playerid ) == TEAM_GREEN ) { //Ezt arra helyettesítsd, amivel a csapatokat ellenorzöd SetTimerEx( \"OnPlayerPlantBomb\", 5000, false, \"d\", playerid ); } return 1;}public OnPlayerPlantBomb( playerid ) { if( GetPlayerState( playerid ) == PLAYER_STATE_NONE || !IsPlayerInCheckpoint( playerid ) ) return; SendClientMessageToAll( COLOR_GREEN, \"A zöldek nyertek!\" ); //Egyéb kódok}
new iSecCounter[ MAX_PLAYERS ];public OnPlayerPlantBomb( playerid );public OnPlayerEnterCheckpoint( playerid ) { //Leelenorzöd, hogy a játékos csapata a zöld csapat-e if( GetPlayerTeam( playerid ) == TEAM_GREEN ) { //Ezt arra helyettesítsd, amivel a csapatokat ellenorzöd SetTimerEx( \"OnPlayerPlantBomb\", 1000, true, \"d\", playerid ); } return 1;}public OnPlayerPlantBomb( playerid ) { if( GetPlayerState( playerid ) == PLAYER_STATE_NONE ) return; else if( !IsPlayerInCheckpoint( playerid ) ) { new szName[ MAX_PLAYER_NAME ]; new szMsg[ 128 ]; GetPlayerName( playerid, szName, sizeof szName ); format( szMsg, sizeof szMsg, \"~w~%s ~r~elhagyta~w~ a bombalerakó helyet!\", szName ); GameTextForAll( szMsg, 3, 3000 ); return; } ++iSecCounter[ playerid ]; if( iSecCounter[ playerid ] == 5 ) { iSecCounter[ playerid ] == 0; SendClientMessageToAll( COLOR_GREEN, \"A zöldek nyertek!\" ); //Egyéb kódok } }
Keress rá angol fórumon a CarTheft modra, onnan találsz ötleteket, most így hírtelen nem tudom hogy kell.
new premier;
premier = (426,blablabla..)
#include <a_samp>#include <core>#include <float>static gTeam[MAX_PLAYERS];new gObjectiveAirPlayer;#define TEAM_ATTACK 1#define TEAM_DEFEND 2#define TEAM_ATTACK_COLOR 0xFF0000AA#define TEAM_DEFEND_COLOR 0x1E90FFAAnew player[MAX_PLAYER_NAME];new str[128];new premier;forward SetPlayerToTeamColor(playerid);forward SetupPlayerForClassSelection(playerid);forward SetPlayerTeamFromClass(playerid,classid);forward BlueWin();forward GreenWin();forward ExitTheGameMode();//---------------------------------------------------------main(){print(\"\\n--------------------------\");print(\"The Premier Mode By Volum3\");print(\"MAP: The Premier, By: Volum3\");print(\"--------------------------\\n\");}//---------------------------------------------------------public OnGameModeInit(){SetGameModeText(\"The Premier\");SetTimer(\"BlueWin\",300000,0);UsePlayerPedAnims();ShowPlayerMarkers(1);ShowNameTags(1);SetWorldTime(19);// ATTACKAddPlayerClass(108,495.349,-1534.515,20.234,90.0,4,1,24,500,30,200);AddPlayerClass(110,495.349,-1534.515,20.234,90.0,4,1,24,500,30,200);// DEFENDAddPlayerClass(114,668.257,-1558.865,19.027,180.0,4,1,24,500,30,200);AddPlayerClass(115,668.257,-1558.865,19.027,180.0,4,1,24,500,30,200);AddPlayerClass(116,668.257,-1558.865,19.027,180.0,4,1,24,500,30,200);// PREMIERpremier = CreateVehicle(426,695.056,-1571.168,14.298,270.0,6,6,10000); // ATTACK VEHICLESCreateVehicle(581,488.082,-1545.200,17.626,180.0,6,6,120000);CreateVehicle(581,490.916,-1543.909,17.608,180.0,6,6,120000);CreateVehicle(581,493.801,-1542.721,17.590,180.0,6,6,120000);CreateVehicle(581,486.772,-1539.098,18.134,180.0,6,6,120000);CreateVehicle(581,490.306,-1538.055,18.103,180.0,6,6,120000);CreateVehicle(581,493.249,-1536.723,18.107,180.0,6,6,120000);CreateVehicle(581,490.124,-1533.652,18.482,180.0,6,6,120000);CreateVehicle(581,487.345,-1534.772,18.481,180.0,6,6,120000);CreateVehicle(581,484.300,-1536.117,18.458,180.0,6,6,120000);CreateVehicle(581,490.197,-1529.292,18.751,180.0,6,6,120000);CreateVehicle(581,487.381,-1530.532,18.749,180.0,6,6,120000);CreateVehicle(581,484.533,-1532.032,18.705,180.0,6,6,120000); return 1;}//---------------------------------------------------------public OnPlayerConnect(playerid){SetPlayerColor(playerid,0x000000FF);SetPlayerScore(playerid,0);GetPlayerName(playerid,player,100);format(str,128,\"%s csatlakozott a szeróra. [Connect]\",player);SendClientMessageToAll(0x626160FF,str);SendClientMessage(playerid,0x0093FFFF,\"**Üdvözöllek a The Premier modban!\"); return 1;}//---------------------------------------------------------public OnPlayerDisconnect(playerid, reason){ GetPlayerName(playerid,player,100); switch(reason) { case 0: {format(str, sizeof(str), \"%s kifagyott. [Crash] \",player);SendClientMessageToAll(0xFEE401FF, str);}case 1: {format(str, sizeof(str), \"%s lecsatlakozott. [Disconnect] \",player);SendClientMessageToAll(0x626160FF, str);}case 2: {format(str, sizeof(str), \"%s ki lett rúgva. [Kick] \",player);SendClientMessageToAll(0xFB0B04FF, str);}}return 1;}public OnPlayerStateChange(playerid, newstate, oldstate){new vehicleid = GetPlayerVehicleID(playerid);if(newstate == PLAYER_STATE_DRIVER){ if(!IsPlayerInAnyVehicle(playerid)) { if(gTeam[playerid] == TEAM_ATTACK) { if(vehicleid == premier) { SetPlayerColor(playerid,0xFFFF00AA); SetPlayerCheckpoint(playerid,495.349,-1534.515,20.234,5.0); gObjectiveAirPlayer = 1; } else if(gTeam[playerid] == TEAM_DEFEND && vehicleid == premier) { SetPlayerHealth(playerid,0); SetPlayerToTeamColor(playerid); SendClientMessage(playerid,0x0173FEFF,\"Többé ne szálj be a kocsiba! <szerintem.>\"); } }}else if(newstate == PLAYER_STATE_ONFOOT){ if(playerid == gObjectiveAirPlayer) { gObjectiveAirPlayer = 0; SetPlayerToTeamColor(playerid); }}}return 1;}public OnPlayerEnterCheckpoint(playerid){new vehicleid = GetPlayerVehicleID(playerid);if (!IsPlayerInAnyVehicle(playerid)){if ( vehicleid == premier){ if(gTeam[playerid] == TEAM_ATTACK && vehicleid == premier) { GreenWin(); }}}return 1;}public BlueWin(){SetTimer(\"ExitTheGameMode\", 10000, 0);GameTextForAll(\"~w~a ~b~kek ~w~csapat nyert\",5000,0);return 1;}public GreenWin(){SetTimer(\"ExitTheGameMode\", 10000, 0);GameTextForAll(\"~w~a ~g~zold ~w~ csapat nyert\",5000,0);return 1;}public ExitTheGameMode(){GameTextForAll(\"~g~mapv€lt€s~w~... ~n~kerlek v€rj~g~...\",2000,0);SendRconCommand(\"gmx\");}//----------------------------------------------------------public SetupPlayerForClassSelection(playerid){SetPlayerInterior(playerid,0);SetPlayerPos(playerid,110.871,1024.826,14.658);SetPlayerFacingAngle(playerid, 95.0);SetPlayerCameraPos(playerid,109.486,1037.871,14.291);SetPlayerCameraLookAt(playerid,110.871,1024.826,14.658);}//---------------------------------------------------------public SetPlayerTeamFromClass(playerid,classid){if(classid == 0 || classid == 1) {gTeam[playerid] = TEAM_ATTACK;} else if(classid == 2 || classid == 3 || classid == 4) { gTeam[playerid] = TEAM_DEFEND;}}//---------------------------------------------------------public SetPlayerToTeamColor(playerid){if(gTeam[playerid] == TEAM_ATTACK) {SetPlayerColor(playerid,TEAM_ATTACK_COLOR);} else if(gTeam[playerid] == TEAM_DEFEND) { SetPlayerColor(playerid,TEAM_DEFEND_COLOR);}}//---------------------------------------------------------public OnPlayerRequestClass(playerid, classid){SetPlayerInterior(playerid,0);SetPlayerPos(playerid,110.871,1024.826,14.658);SetPlayerFacingAngle(playerid, 95.0);SetPlayerCameraPos(playerid,109.486,1037.871,14.291);SetPlayerCameraLookAt(playerid,110.871,1024.826,14.658);SetPlayerTeamFromClass(playerid,classid);if(classid == 0 || classid == 1) {GameTextForPlayer(playerid,\"~y~Yellow ~w~Team\",500,4);} else if(classid == 2 || classid == 3 || classid == 4) { GameTextForPlayer(playerid,\"~b~Blue ~w~Team\",500,4);}return 1;}//---------------------------------------------------------public OnPlayerSpawn(playerid){SetPlayerToTeamColor(playerid);SetPlayerInterior(playerid,0);if(gTeam[playerid] == TEAM_ATTACK) { SetVehicleParamsForPlayer(premier,playerid,1,0);SendClientMessage(playerid,0xFCE303FF,\"Lopd el az ellenfél Premier-jét 5 perc alatt.\");}else if(gTeam[playerid] == TEAM_DEFEND) {SetVehicleParamsForPlayer(premier,playerid,1,1);SendClientMessage(playerid,0x0173FEFF,\"Védd meg a Premier-t az ellenféltol 5 percig.\");}return 1;}//---------------------------------------------------------//---------------------------------------------------------public OnPlayerDeath(playerid, killerid, reason){if(killerid == INVALID_PLAYER_ID) { SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);} else { if(gTeam[killerid] != gTeam[playerid]) { // Valid kill SendDeathMessage(killerid,playerid,reason); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); GivePlayerMoney(killerid,GetPlayerMoney(killerid)+5000); }else { // Team kill SetPlayerScore(killerid,GetPlayerScore(killerid)-1);}}return 1;}
if(!IsPlayerInAnyVehicle(playerid))