Szerző Téma: GameMode segítségkérés.  (Megtekintve 475 alkalommal)

GameMode segítségkérés.
« Dátum: 2012. december 24. - 00:24:33 »
0 Show voters
Helló.
Filterscriptbe tutorial alapján csináltam egy minigunos DM zónát. Ezt szeretném beletenni a gamemodba, megy is, csak azt nemtudom, hova tegyem ezt: \"else if(minigun[playerid] != -1) return SendClientMessage(playerid,0xFF9933AA,\"Elöbb lépj ki a minigun zónából!\");\"
Ez tenné azt, hogy ne tugyak DM zónában más parancsot használni. Valaki meg tudná nekem csinálni? Mert mindenhogy próbáltam de nem megy. (Kezdõ vagyok.)
 
#include < a_samp >
#include < zcmd >
#include < foreach >
#include < core >
#include < float >
// SZINEK //
#define PIROS 0xff0000AA
#define NARANCS 0xFF9933AA
#define ZOLD 0x008000AA
#define PINK 0xFF66FFAA
#define AQUA 0x7CFC00AA
#define KEK 0x0000FFAA
#define CITROM 0xFFFF00AA
#define FEKETE 0xFFFFFFAA
// VÁLTOZÓK //
new i_string [ 256 ] ;
new iSpawnSet[MAX_PLAYERS];
new sebesseg[MAX_PLAYERS];
static minigun[MAX_PLAYERS]={ -1, ... };
forward SetupPlayerForClassSelection(playerid);
// PARANCSOK //
CMD:ahegy(playerid, params[])
{
SetPlayerPos(playerid,-372.7802,2127.4292,133.0850);
return 1;
}
CMD:exitmini(playerid, params[])
{
    if(minigun[playerid] == -1) return SendClientMessage(playerid,KEK, \"Nem vagy Minigun zónában!\");
    minigun[playerid] = -1;
    SpawnPlayer(playerid);
    return SendClientMessage(playerid,CITROM,\"Kiléptél a Minigun zónából.\");
    }
CMD:mini(playerid, params[])
{
    minigun[playerid] = 0;
    SpawnPlayer(playerid);
    SetPlayerVirtualWorld(playerid,minigun[playerid]);
    SendClientMessage(playerid,CITROM,\"Csatlakoztál a Minigun DM-hez.\");
    return 1;
}
public OnGameModeInit ( )
{
    UsePlayerPedAnims ( ) ;
    SetGameModeText ( \"Jeffi Modja\" );
    SendRconCommand ( \"mapname Jeffi City\" ) ;
    SendRconCommand ( \"hostname Jeffi Szeró\" ) ;
    AddPlayerClass ( 0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ; // SKINEK
    AddPlayerClass ( 3, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 7, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 13, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 19, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 22, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 23, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 29, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 39, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 47, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 48, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 49, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 60, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 62, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 70, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 73, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 92, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 104, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 115, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 137, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 188, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 195, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 192, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 196, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 205, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 211, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 241, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 264, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 271, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 286, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 287, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddPlayerClass ( 299, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0 ) ;
    AddStaticVehicle(411,2024.5885,1327.3512,10.5479,269.7550,73,107); // KOCSIK
    AddStaticVehicle(411,2024.4703,1323.0281,10.5486,270.9145,80,94);
    AddStaticVehicle(411,2024.6323,1318.4857,10.5493,269.6869,2,22);
    AddStaticVehicle(411,2024.7622,1314.1855,10.5443,271.5799,62,9);
    AddStaticVehicle(411,2025.2914,1309.6460,10.5474,271.1253,65,63);
    AddStaticVehicle(411,2026.1683,1305.0928,10.5474,270.7816,69,124);
    AddStaticVehicle(411,2027.1851,1300.9819,10.5474,271.8912,35,110);
    AddStaticVehicle(427,2025.3203,1358.8352,10.9523,270.3116,126,128);
    AddStaticVehicle(596,2024.9706,1363.2931,10.5402,269.7259,26,76);
    AddStaticVehicle(597,2024.9331,1367.6700,10.5885,270.4735,77,86);
    AddStaticVehicle(598,2025.0200,1371.9469,10.5659,268.8702,78,18);
    AddStaticVehicle(601,2025.4951,1376.4237,10.5791,268.7289,100,53);
    AddStaticVehicle(490,2026.5857,1380.8568,10.9493,268.8730,0,0);
    AddStaticVehicle(432,2025.0844,1391.4359,10.8363,249.6683,0,7);
 
    print(\"\\n--------------------------------------\");
    print(\" Jeffi modja\");
    print(\"--------------------------------------\\n\");
   
    return 1;
}
main ()
{
}
public OnPlayerConnect ( playerid )
{
    PlayAudioStreamForPlayer ( playerid , \"http://ddlp2.data.hu/get/750910311044/5659252/Jolly___Igazi_gigolo_2012.mp3\" ) ;
    format( i_string , sizeof ( i_string ) , \"*** %s Csatlakozott Jeffi szerójára :)\" , pName ( playerid ) ) ;
    SendClientMessageToAll (NARANCS , i_string ) ;
    minigun[playerid] = -1;
    return 1 ;
}
public OnPlayerDisconnect ( playerid )
{
    format( i_string , sizeof ( i_string ) , \"*** %s Kilépett Jeffi  szerójáról :(.\" , pName ( playerid ) ) ;
    SendClientMessageToAll (NARANCS , i_string ) ;
    return 1 ;
}
public OnPlayerRequestClass(playerid, classid)
{
iSpawnSet[playerid] = 0;
SetupPlayerForClassSelection(playerid);
return 1;
}
public SetupPlayerForClassSelection(playerid)
{
      SetPlayerInterior(playerid,14);
      SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
      SetPlayerFacingAngle(playerid, 270.0);
      SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
      SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}
public OnPlayerSpawn ( playerid )
{
    SetPlayerInterior(playerid,0);
    SendClientMessage ( playerid , AQUA ,  \"Sikeresen lespawnoltál :)\" ) ;
    SetPlayerColor ( playerid , AQUA ) ;
    sebesseg[playerid] = 1;
    switch(minigun[playerid])
   {
       case 0: //0-ás azonosító
       {
           SetPlayerPos(playerid,213.8617,1875.3964,13.1470);
           SetPlayerFacingAngle(playerid,260.0);
           ResetPlayerWeapons(playerid);
           GivePlayerWeapon(playerid,38,99999);
           SetPlayerVirtualWorld(playerid,minigun[playerid]);
      }
   }
return 1 ;
}
public OnPlayerDeath( playerid, killerid, reason )
{
    SendDeathMessage ( killerid , playerid  ,reason ) ;
    SendClientMessage ( playerid , PIROS , \"Meghaltál..\" ) ;
    SendClientMessage ( killerid , ZOLD , \"Megöltél egy balfaszt.. :D\" ) ;
    return 1 ;
}
stock pName( playerid ) //Névlekérés
{
   static
   PlayerName[ MAX_PLAYER_NAME ];
   GetPlayerName( playerid, PlayerName, MAX_PLAYER_NAME );
   return PlayerName;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
        if(newkeys & KEY_FIRE)
        {
 
        if(sebesseg[playerid] == 1)
        {
        new Float:vx,Float:vy,Float:vz;
        GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
        SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy *1.8, vz * 1.8);
        }
        }
        }
 
        if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
        if (newkeys & KEY_CROUCH)
        {
        if(sebesseg[playerid] == 1)
        {
        new Float:x, Float:y, Float:z;
        GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
        SetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z+0.3);
        }
        }
        }
        return 1;
        }
public OnGameModeExit ( )
{
    return 1;
}

 

Dupla hozzászólás automatikusan összefûzve. ( 2012. december 24. - 19:33:22 )

valaki segitsen keremszepen. :S
« Utoljára szerkesztve: 2012. december 24. - 19:33:22 írta asdghostrider »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal