[HELP]Team_Army
#1

Ok i made a command , but i want it to be used by team army (pRank 2) also . Here is the command :

pawn Код:
if(strcmp(cmd, "/stun", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /stun [playerid]");
            return 1;
        }
        giveplayerid = strval(tmp);
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        if(gTeam[playerid] == TEAM_COP)
        {
            if(PlayerToPoint(8.0, giveplayerid, x , y, z))
            {
                if(gTeam[playerid] != TEAM_COP && PlayerInfo[playerid][pRank] == 1 || gTeam[playerid] != TEAM_ARMY && PlayerInfo[playerid][pRank] == 2)
                {
                    Stunned[giveplayerid] = 1;
                    KillTimer(StunTimer[giveplayerid]);
                    StunTimer[giveplayerid] = SetTimerEx("SetPlayerUnstun", 10000, false, "d", giveplayerid);
                    if(gTeam[playerid] == TEAM_COP)(format string, sizeof(string), "Officer %s has stunned (suspect) %s.", PlayerName[playerid], PlayerName[giveplayerid]);
                    SendClientMessageToAll(COLOR_BLUE, string);
                    if(gTeam[playerid] == TEAM_ARMY){format string, sizeof(string), "Soldier %s has stunned (suspect) %s.", PlayerName[playerid], PlayerName[giveplayerid]);
                    SendClientMessageToAll(COLOR_BLUE, string);
                    ApplyAnimation(playerid,"PED","ARRESTgun",4.1,0,1,1,1,1);
                    ApplyAnimation(giveplayerid,"PED","KO_shot_stom",4.1,0,1,1,1,1);
                    TogglePlayerControllable(giveplayerid, false);
                    KillTimer(StunTimer2[playerid]);
                    StunTimer2[playerid] = SetTimerEx("ClearPlayerAnimations", 5000, false, "d", playerid);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_RED, "You could not stun an officer that follows the law to.");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "That playerid is not close (enough) to you!");
            }
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED,"You are not a part of the cops team.");
        }
        return 1;
}
And when i compile it gives me loads of errors !
Reply
#2

pawn Код:
if((gTeam[playerid] == TEAM_COP) && (PlayerInfo[playerid][pRank] == 1 || PlayerInfo[playerid][pRank] == 2))
Reply
#3

Look i edited it . i have now another problem !
Reply
#4

but i added this :
pawn Код:
if(gTeam[playerid] == TEAM_COP)(format string, sizeof(string), "Officer %s has stunned (suspect) %s.", PlayerName[playerid], PlayerName[giveplayerid]);
                    SendClientMessageToAll(COLOR_BLUE, string);
                    if(gTeam[playerid] == TEAM_ARMY){format string, sizeof(string), "Soldier %s has stunned (suspect)  
%s."
, PlayerName[playerid], PlayerName[giveplayerid]);
SendClientMessageToAll(COLOR_BLUE, string);
so i think here is the problem , because i want to send different messages !
Reply
#5

still shit loads of errors !
Reply
#6

Show us the errors rofl.

And Highlight the lines with error with //
Reply
#7

Lol see ?
pawn Код:
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(1517) : error 017: undefined symbol "strtok"
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(1517) : error 033: array must be indexed (variable "cmd")
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(1797) : error 004: function "OnHouseUpdate" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(1879) : error 004: function "OnHouseUpdate" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(2097) : error 004: function "OnHouseUpdate" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(2247) : error 004: function "OnHouseUpdate" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(2465) : error 004: function "OnHouseUpdate" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(3057) : error 004: function "OnHouseUpdate" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(3428) : error 004: function "OnHouseUpdate" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(3527) : error 004: function "OnHouseUpdate" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(3847) : error 004: function "OnHouseUpdate" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(3915) : error 004: function "OnHouseUpdate" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(1516) : warning 203: symbol is never used: "idx"
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(3939) : error 004: function "OnHouseReload" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(3940) : error 004: function "OnBusinessReload" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(3941) : error 004: function "SetupMenus" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(3944) : error 004: function "LoadGangZone" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4507) : error 004: function "SaveAllStats" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4815) : error 004: function "SendVehicleToRespawn" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4834) : error 004: function "SaveAllStats" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4880) : error 004: function "UpdatePlayer" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4884) : error 004: function "AllPlaySound" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4899) : error 004: function "SellHouse" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4908) : error 004: function "SellBusiness" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4911) : error 004: function "UpdateGangZone" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4912) : error 004: function "OnHouseUpdate" is not implemented
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4913) : error 004: function "OnBusinessUpdate" is not implemented

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
Reply
#8

Hoborific code is fine. It might be your problem. Try to go to your gamemode directory and open panwo in that directory where you gamemode is.
Reply
#9

you have to many Else's
Reply
#10

If i delete this command the gamemode doesn't give any errors !
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)