SA-MP Forums Archive
Whats wrong with code - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Whats wrong with code (/showthread.php?tid=455833)



Whats wrong with code - Gaurav_Rawat - 03.08.2013

Basically i want wen A team use Left Alt ,If he is of Team B and is near him he should die at instant.
I tried it but my code didn't work can you help me out please

pawn Код:
if(PRESSED(KEY_WALK))
    {
        if(team[playerid] == TEAM_ZOMBIE)
        {
            if(pInfo[playerid][pZombieClass] == TYRANTZOMBIE)
            {
                new victimid = GetClosestPlayer(playerid);
                if(IsPlayerConnected(victimid))
                {
                    switch(GetPlayerSkin(victimid))
                    {
                        case NON_IMMUNE,70:
                        {
                            if(GetDistanceBetweenPlayers(playerid,victimid) < 1.5)
                            {
                                    if(gettime() - 9 < Abilitys[playerid][TyrantAttack]) return GameTextForPlayer(playerid,"~w~ Still recovering",4000,5);
                            {
                                    new Float:hp,zmstring[256];
                                    GetPlayerHealth(victimid,hp);
                                    SetPlayerHealth(victimid, hp -200);
                                    GameTextForPlayer(victimid,"~n~~n~~n~~n~~y~Tyrant Attack ",3000,5);
                                    GivePlayerXP(playerid,15);
                                    format(zmstring,sizeof(zmstring), ""info""COL_PINK" %s has been Tyrant attacked by %s",PlayerName(victimid),PlayerName(playerid));
                                    SendClientMessageToAll(-1,zmstring);

                                    new msg[128];
                                    format(msg, sizeof(msg), "02%s has been Tyrant attacked by %s",PlayerName(victimid),PlayerName(playerid));
                                    IRC_GroupSay(groupID, IRC_CHANNEL, msg);
                                    Abilitys[playerid][TyrantAttack] = gettime();

                                   
                                }
                            }
                        }
                    }
                }
            }
        }
        }
Can anybody help me ?