[Help] I Need Help and Idea
#1

Hi All,
Im working on one mini-game so i want that who only left (when all players die) to be a winer , so i really dont have any idea how to make it , if someone have idea , plss help
this is my full script:
pawn Код:
#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("           Hotring Derby                ");
    print("--------------by Patomaxx-------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n--------------------------------------");
    print("          Hotring Derby                ");
    print("--------------by Patomaxx-------------\n");
}

#endif
new Float:gRandomPlayerSpawns[14][3] = {
{61.0153, 1990.3171, 105.6728},
{34.3443, 1990.6935, 105.6728},
{13.8005, 1990.6920, 105.6728},
{-7.7296, 1990.9467, 105.6728},
{-24.3688, 2010.7242, 105.6728},
{9.7069, 2010.8684, 105.6728},
{35.3656, 2011.3068, 105.6728},
{67.0939, 2010.2933, 105.6728},
{57.9660, 2029.5924, 105.6728},
{33.8607, 2031.1937, 105.6728},
{9.0445, 2032.6832, 105.6728},
{-11.5876, 2033.9213, 105.6728},
{-8.5828, 2014.0153, 105.6728},
{78.1693, 2000.5719, 105.6728}
};
forward SetPlayerRandomSpawn();
new vehicle;
public OnGameModeInit()
{

    SetGameModeText("Hotring Derby");

    CreateObject(6959, -17.49, 2033.79, 104.63,   0.00, 0.00, 0.00,1000);
    CreateObject(6959, 23.84, 2033.79, 104.63,   0.00, 0.00, 0.00,1000);
    CreateObject(6959, 65.18, 2033.79, 104.63,   0.00, 0.00, 0.00,1000);
    CreateObject(6959, 65.18, 1993.79, 104.63,   0.00, 0.00, 0.00,1000);
    CreateObject(6959, 23.85, 1993.80, 104.63,   0.00, 0.00, 0.00,1000);
    CreateObject(6959, -17.50, 1993.79, 104.63,   0.00, 0.00, 0.00,1000);
    CreateObject(4019, -5.49, 1945.17, 89.56,   0.00, 0.00, 0.00,1000);
    CreateObject(4019, 53.54, 1945.11, 89.56,   0.00, 0.00, 0.00,1000);
    CreateObject(4019, 51.98, 2086.99, 89.56,   0.00, 0.00, 0.00,1000);
    CreateObject(4019, -3.32, 2087.98, 89.56,   0.00, 0.00, 0.00,1000);
    CreateObject(18813, -49.30, 2014.53, 79.25,   0.00, 0.00, 0.00,1000);
    CreateObject(4019, -69.21, 1944.38, 89.56,   0.00, 0.00, 0.00,1000);
    CreateObject(4019, -71.63, 2088.05, 89.56,   0.00, 0.00, 0.00,1000);
    CreateObject(18813, 95.36, 2013.89, 79.25,   0.00, 0.00, 0.00,1000);
    CreateObject(4019, 117.82, 1944.92, 89.56,   0.00, 0.00, 0.00,1000);
    CreateObject(4019, 120.22, 2088.47, 89.56,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, -17.80, 1996.82, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, -17.32, 2015.08, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, -17.86, 2037.39, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 3.55, 2034.95, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 4.31, 2013.95, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 4.48, 1995.04, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 22.39, 1995.27, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 45.81, 1992.52, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 24.67, 2016.17, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 24.97, 2037.05, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 45.05, 2040.24, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 46.60, 2016.22, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 65.36, 2041.03, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 68.77, 2017.81, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(1225, 71.06, 1995.04, 104.98,   0.00, 0.00, 0.00,1000);
    CreateObject(3509, -33.18, 2013.85, 104.47,   0.00, 0.00, 0.00,1000);
    CreateObject(3509, 2.06, 2013.85, 104.47,   0.00, 0.00, 0.00,1000);
    CreateObject(3509, 44.35, 2014.29, 104.47,   0.00, 0.00, 0.00,1000);
    CreateObject(3509, 82.45, 2013.69, 104.47,   0.00, 0.00, 0.00,1000);

    SetWorldTime(19);
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 21.5663,2011.6462,194.3670);
    SetPlayerCameraLookAt(playerid, 21.4463,2011.4694,105.5131);
    return 1;
}
public OnPlayerSpawn(playerid)
{
    SetPlayerSkin(playerid,104);
    vehicle = CreateVehicle(502,0,0,0,0,-1,-1,1);
    PutPlayerInVehicle(playerid,vehicle,0);
    SetPlayerRandomSpawn();
    SendClientMessage(playerid,0xFFFFFFFF,"Don't try to leave the car or you will die!");
    SendClientMessage(playerid,0xFF0000FF,"Destroy Other Vehicles!");
    return 1;
}
public SetPlayerRandomSpawn()
{
    new rand = random(sizeof(gRandomPlayerSpawns));
    SetVehiclePos(vehicle, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]);
   
    return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid,playerid,reason);
    new name[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"**%s is died and finished hes turn!",name);
    SendClientMessageToAll(0xFF0000FF,string);

        SetPlayerCameraPos(playerid, 21.5663,2011.6462,194.3670);
    SetPlayerCameraLookAt(playerid, 21.4463,2011.4694,105.5131);
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    SetPlayerHealth(playerid,0);
    DestroyVehicle(vehicleid);
    return 1;
}

public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,15,-49.4449, 2014.3015, 57.4837))
    {
        SetPlayerHealth(playerid,0);
        return 1;
    }
    else if(IsPlayerInRangeOfPoint(playerid,15,95.0335, 2013.5691, 57.4837))
    {
        SetPlayerHealth(playerid,0);
        return 1;
    }
    return 1;
}
Reply
#2

http://pastebin.com/XQk9G6DT
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)