Anti God Mode
#10

Quote:
Originally Posted by xomka
View Post
взрывом
Можно сделать примерно так...

pawn Code:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], tmp[256], idx;
    cmd = strtok(cmdtext, idx);
    tmp = strtok(cmdtext,idx);
   
    if(strcmp(cmd, "/testgm", true) == 0)
    {
       
        if(!IsPlayerAdmin( playerid ))return SendClientMessage(playerid, 0xffffffff, "Вы не админ");
        if(!strlen(tmp))return SendClientMessage(playerid, 0xffffffff, "Укажите id игрока");
        if(!IsNumeric(tmp))return SendClientMessage(playerid, 0xffffffff, "Неверно указан id игрока");
        new player = strval(tmp);
        if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID)
        {
                   if(IsPlayerInAnyVehicle(player))
                   {
                        new vehicleid = GetPlayerVehicleID(playerid);
                        new Float:health, Float:X, Float:Y, Float:Z;
                        GetVehicleHealth(vehicleid, health);
                SetPVarFloat(player, "VehicleHealth", health);
                SetVehicleHealth(vehicleid, 1000);
                GetPlayerPos(player,X,Y,Z);
                CreateExplosion(X,Y,Z-6,8,0);
                SetTimerEx("TestGmModeInVehicle",200,0, "i", player);
                    }
                    else
            {
                new Float:health, Float:X, Float:Y, Float:Z;
                        GetPlayerHealth(player, health);
                        SetPlayerHealth(player, 100);
                SetPVarFloat(playerid, "PlayerHealth", health);
                GetPlayerPos(player,X,Y,Z);
                CreateExplosion(X,Y,Z-6,8,0);
                SetTimerEx("TestGmModeOnFoot",200,0, "i", player);
            }
                }
        return 1;
    }
    return 0;
}

forward TestGmModeOnFoot(playerid);
public TestGmModeOnFoot(playerid)
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    if(health < 100)
    {
        SendClientMessageToAll(0xffffffff,"Проверка пройдена ;)");
        SetPlayerHealth(playerid, GetPVarFloat(playerid, "PlayerHealth"));
    }
    else
    {
        SendClientMessageToAll(0xffffffff,"чиииииитеееееер!!!!!!!!!!!!!");
        SetPlayerHealth(playerid, GetPVarFloat(playerid, "PlayerHealth"));
    }
    return 1;
}

forward TestGmModeInVehicle(playerid);
public TestGmModeInVehicle(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Float:health;
    GetVehicleHealth(vehicleid, health);
    if(health < 1000)
    {
        SendClientMessageToAll(0xffffffff,"Проверка пройдена ;)");
        RepairVehicle(vehicleid);
    }
    else SendClientMessageToAll(0xffffffff,"чиииииитеееееер!!!!!!!!!!!!!");
    return 1;
}

stock IsNumeric(string[])
{
        for (new i = 0, j = strlen(string); i < j; i++)
        if (string[i] > '9' || string[i] < '0') return 0;
        return 1;
}

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply


Messages In This Thread
Anti God Mode - by [Saint] - 05.06.2010, 05:04
Re: Anti God Mode - by Johnny_Xayc - 05.06.2010, 07:33
Re: Anti God Mode - by Fro1sha - 05.06.2010, 08:44
Re: Anti God Mode - by Makar93 - 05.06.2010, 10:19
Re: Anti God Mode - by MX_Master - 05.06.2010, 16:30
Re: Anti God Mode - by xomka - 05.06.2010, 17:21
Re: Anti God Mode - by [Saint] - 06.06.2010, 01:29
Re: Anti God Mode - by Nikid - 07.06.2010, 14:29
Re: Anti God Mode - by Romanius - 07.06.2010, 15:06
Re: Anti God Mode - by false - 30.09.2010, 11:58
Re: Anti God Mode - by Aleks10 - 30.09.2010, 12:19
Re: Anti God Mode - by false - 30.09.2010, 12:35
Re: Anti God Mode - by lost13 - 30.09.2010, 12:39
Re: Anti God Mode - by Aleks10 - 30.09.2010, 14:55
Re: Anti God Mode - by Romanius - 30.09.2010, 15:58
Re: Anti God Mode - by lost13 - 30.09.2010, 16:02
Re: Anti God Mode - by false - 30.09.2010, 17:11
Re: Anti God Mode - by Aleks10 - 30.09.2010, 17:53
Re: Anti God Mode - by lost13 - 30.09.2010, 19:03
Re: Anti God Mode - by false - 30.09.2010, 20:02
Re: Anti God Mode - by lost13 - 01.10.2010, 09:11
Re: Anti God Mode - by Aleks10 - 01.10.2010, 13:30
Re: Anti God Mode - by lost13 - 01.10.2010, 14:33
Re: Anti God Mode - by K-911 - 01.10.2010, 15:00
Re: Anti God Mode - by lost13 - 01.10.2010, 15:05
Re: Anti God Mode - by K-911 - 01.10.2010, 15:21
Re: Anti God Mode - by lost13 - 01.10.2010, 15:22
Re: Anti God Mode - by K-911 - 01.10.2010, 15:27
Re: Anti God Mode - by EROS_174RUS - 03.10.2010, 10:55
Re: Anti God Mode - by Andreq - 04.10.2010, 10:07
Re: Anti God Mode - by Stepashka - 25.11.2010, 07:43
Re: Anti God Mode - by DJ_Smagold - 25.11.2010, 07:46
Re: Anti God Mode - by On1xS - 26.11.2010, 17:33
Re: Anti God Mode - by DJ_Smagold - 28.11.2010, 05:38

Forum Jump:


Users browsing this thread: 1 Guest(s)