fast question
#2

Код:
if (strcmp(cmd, "/drag", true) == 0)
    {
 new giveplayerid = strval(tmp);
      if(sapd[playerid] >=1)
        {
          tmp = strtok(cmdtext, idx);
            giveplayerid = strval(tmp);
          if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_RED, "USAGE: /drag [playerid]");
                return 1;
            }
            if(!IsPlayerConnected(giveplayerid))
            {
                format(string, sizeof(string), "%d is not an active player.", giveplayerid);
                SendClientMessage(playerid,COLOR_RED, string);
                return 1;
            }
           
            if(giveplayerid == playerid)
            {
                SendClientMessage(playerid, COLOR_RED, "You cannot drag yourself!");
                return 1;
            }
            if(DragTimer[playerid] <= 0)
            {
                if(IsPlayerConnected(giveplayerid) == 1)
                {
                      new Float:x, Float:y, Float:z;
                      GetPlayerPos(giveplayerid, x, y, z);
                       if(IsPlayerInRangeOfPoint(playerid, 7.0, x, y, z))
                      {
                         GetPlayerName(giveplayerid, sendername, sizeof(sendername));
                         GetPlayerName(playerid, playername, sizeof(playername));
                         format(string, sizeof(string), "Officer %s started dragging %s", playername, sendername);
                         ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
                         DragTimer[playerid] = SetTimerEx("Drag", 1000, 1, "ii", playerid, giveplayerid);
                         TogglePlayerControllable(giveplayerid, 0);
                         return 1;
                     }
                     else SendClientMessage(playerid, COLOR_RED, " This player must be near you ")
                }
            }
        }

        else
        {
            SendClientMessage(playerid, COLOR_RED, "  You are not a Cop / FBI / Marine !");
        }
        return 1;
  }
Reply


Messages In This Thread
fast question - by bartje01 - 15.07.2010, 15:30
Re: fast question - by samuel_hamza - 15.07.2010, 15:51
Re: fast question - by bartje01 - 15.07.2010, 16:38

Forum Jump:


Users browsing this thread: 1 Guest(s)