Hitman - /gethit
#1

Hello, i have a problem. I am in Hitman and when i write /gethit - to take a hit, on server comes: unknow server command, but i have this command. When a player is online, then it goes. And when no players play, then came: unknown server command:

pawn Код:
if(strcmp(cmd, "/gethit", true) == 0)
{
   if(PlayerInfo[playerid][pMember] == 8)
   {
   if(IsPlayerConnected(playerid))
   {
   new xd[MAX_PLAYER_NAME];
   new pid = GetRandomPlayer();
   new level = PlayerInfo[pid][pLevel];
   new pdclan = 500*IsACop(pid);
   if(IsPlayerInRangeOfPoint(playerid, 1000, 2809.1042,-1169.9015,1025.5703))
   {
   if(HitInfo[playerid][hitWaiter] == 0)
   {
   if(sscanf(params, "")) return GivePlayerMoney(playerid, 0);
   if(HitInfo[playerid][hitHit] == 0)
   {
   if(IsPlayerConnected(pid))
   {
   GetRandomPlayer();
   GetPlayerName(pid, xd, sizeof(xd));
   HitInfo[playerid][hitHit] = 1;
   hit[pid] = 1;
   HitInfo[playerid][hitWaiter] = 1;
   HitInfo[playerid][hitCijena] = level*100+pdclan;
   format(string, sizeof(string), "HITMAN AGENCY: Uspjesno ste dobili metu pod imenom %s - vrijednost mete: %d$.", xd, HitInfo[playerid][hitCijena]);
   SendClientMessage(playerid, COLOR_GOLD, string);
   SetTimerEx("HitTime", 180000, false, "%d", playerid);
   }
   }
   else
   {
   SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Niste rijesili svoju metu te nemozete uzeti novu.");
   }
   }
   else
   {
   SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Molimo vas da pricekate 3 minuta od proslog uzimanja mete da uzemete novu.");
   }
   }
   else
   {
   SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Nemozete uzeti metu jer niste u bazi.");
   }
   }
   }
   else
   {
   SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Niste u mogucnosti da koristite ovu komandu - samo clanovi Hitman Agencije.");
   }
   return 1;
}
Picture:
Reply
#2

This is how you've started the command:

pawn Код:
if (strcmp("/mycommand", cmdtext, true) == 0)
This is how it's supposed to be:

pawn Код:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
Reply
#3

Who is /mycommand ? o.O
Reply
#4

Nothing, I used /mycommand as an example. In your case it would be:

pawn Код:
if (strcmp("/gethit", cmdtext, true, 10) == 0)
So with that added to the script it would be:

pawn Код:
if (strcmp("/gethit", cmdtext, true, 10) == 0)
{
   if(PlayerInfo[playerid][pMember] == 8)
   {
   if(IsPlayerConnected(playerid))
   {
   new xd[MAX_PLAYER_NAME];
   new pid = GetRandomPlayer();
   new level = PlayerInfo[pid][pLevel];
   new pdclan = 500*IsACop(pid);
   if(IsPlayerInRangeOfPoint(playerid, 1000, 2809.1042,-1169.9015,1025.5703))
   {
   if(HitInfo[playerid][hitWaiter] == 0)
   {
   if(sscanf(params, "")) return GivePlayerMoney(playerid, 0);
   if(HitInfo[playerid][hitHit] == 0)
   {
   if(IsPlayerConnected(pid))
   {
   GetRandomPlayer();
   GetPlayerName(pid, xd, sizeof(xd));
   HitInfo[playerid][hitHit] = 1;
   hit[pid] = 1;
   HitInfo[playerid][hitWaiter] = 1;
   HitInfo[playerid][hitCijena] = level*100+pdclan;
   format(string, sizeof(string), "HITMAN AGENCY: Uspjesno ste dobili metu pod imenom %s - vrijednost mete: %d$.", xd, HitInfo[playerid][hitCijena]);
   SendClientMessage(playerid, COLOR_GOLD, string);
   SetTimerEx("HitTime", 180000, false, "%d", playerid);
   }
   }
   else
   {
   SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Niste rijesili svoju metu te nemozete uzeti novu.");
   }
   }
   else
   {
   SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Molimo vas da pricekate 3 minuta od proslog uzimanja mete da uzemete novu.");
   }
   }
   else
   {
   SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Nemozete uzeti metu jer niste u bazi.");
   }
   }
   }
   else
   {
   SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Niste u mogucnosti da koristite ovu komandu - samo clanovi Hitman Agencije.");
   }
   return 1;
}
Reply
#5

Also on server: Unknown server command
Reply
#6

pawn Код:
if(strcmp(cmdtext, "/gethit", true, 10) == 0)
{
   if(PlayerInfo[playerid][pMember] == 8)
   {
        if(IsPlayerConnected(playerid))
        {
           new xd[MAX_PLAYER_NAME];
           new pid = GetRandomPlayer();
           new level = PlayerInfo[pid][pLevel];
           new pdclan = 500*IsACop(pid);
           
        if(IsPlayerInRangeOfPoint(playerid, 1000, 2809.1042,-1169.9015,1025.5703))
        {
            if(HitInfo[playerid][hitWaiter] == 0)
            {
                if(sscanf(params, "")) return GivePlayerMoney(playerid, 0);
                if(HitInfo[playerid][hitHit] == 0)
                {
                    if(IsPlayerConnected(pid))
                    {
                        GetRandomPlayer();
                        GetPlayerName(pid, xd, sizeof(xd));
                        HitInfo[playerid][hitHit] = 1;
                        hit[pid] = 1;
                        HitInfo[playerid][hitWaiter] = 1;
                        HitInfo[playerid][hitCijena] = level*100+pdclan;
                        format(string, sizeof(string), "HITMAN AGENCY: Uspjesno ste dobili metu pod imenom %s - vrijednost mete: %d$.", xd, HitInfo[playerid][hitCijena]);
                        SendClientMessage(playerid, COLOR_GOLD, string);
                        SetTimerEx("HitTime", 180000, false, "%d", playerid);
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Niste rijesili svoju metu te nemozete uzeti novu.");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Molimo vas da pricekate 3 minuta od proslog uzimanja mete da uzemete novu.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Nemozete uzeti metu jer niste u bazi.");
        }
    }
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Niste u mogucnosti da koristite ovu komandu - samo clanovi Hitman Agencije.");
    }
    return 1;
}
Reply
#7

SERVER: Unknown Command - sniperwars

:-/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)