Jump to content
  • 0

Cum fac un anti team kill?


Th3_Bes7

Question

Cum fac un anti team kill?

Am incercat cu SetPlayerTeam da nu merge tot timpu :|.

Adica daca ai 3 playeri la groove 1 dintre ei are anti team kill iar restul nu.

Nu stiu ce sai mai fac am incercat de toate dar nu merge.

Va rog frumos ajutati-ma.

Dati-mi un tutorial sau explicatimi aici cum sa fac.

FreeMapper

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

poftim

public OnPlayerShootPlayer(shooter,target,Float:damage)
{
    if(PlayerInfo[shooter][pTeam] == PlayerInfo[target][pTeam])
    {
    new Float:newhealth;
    GetPlayerHealth(target, newhealth);
    newhealth = newhealth+sizeof(damage);
    SetPlayerHealth(target, newhealth);
    }
    else return 1;
    return 1;
}

Link to comment
Share on other sites

N-am nevoie de un include ca sa folosesc OnPlayerShootPlayer ?

Nu.

Adaugi inaintea liniilor care ti le-a dat el linia asta:

forward OnPlayerShootPlayer(shooter,target,Float:damage);

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

Link to comment
Share on other sites

error 017: undefined symbol "PlayerInfo"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

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


4 Errors.

FreeMapper

Link to comment
Share on other sites

=-" post="58339" timestamp="1299204448"]

Nu.

Adaugi inaintea liniilor care ti le-a dat el linia asta:

forward OnPlayerShootPlayer(shooter,target,Float:damage);

Callback-ul OnPlayerShootPlayer nu exista in a_samp.inc.

Link to comment
Share on other sites

LaZ" post="58385" timestamp="1299246225"]

Callback-ul OnPlayerShootPlayer nu exista in a_samp.inc.

Stiu ca nu exista. Daca ar exista n-ar mai fi nevoie de pus forward ... etc.

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

Link to comment
Share on other sites

forward OnPlayerShootPlayer(shooter,target,Float:damage);

{

    if(PlayerInfo[shooter][pTeam] == PlayerInfo[target][pTeam])

    {

    new Float:newhealth;

    GetPlayerHealth(target, newhealth);

    newhealth = newhealth+sizeof(damage);

    SetPlayerHealth(target, newhealth);

    }

    else return 1;

    return 1;

}

asta plus ce o zis Vyorel

si am facut si asta daca nu merge aia...il faci o data dar a 2 oara iti da kick

SendClientMessage(killerid, COLOR_RED, "Nu teamkilling sau vei primi kick!"); 

SendDeathMessage(killerid,playerid,reason); 

SetPlayerScore(killerid,GetPlayerScore(killerid)-1); 

GivePlayerMoney(killerid, -2000); 

SetPlayerHealth(killerid,0); 

tk[killerid] ++; 

if(tk[killerid] == 2) 

{ 

SendClientMessage(killerid, COLOR_RED, "Daca mai omori o data vei primi kick!"); 

} 

if(tk[killerid] >= 3) 

{ 

new string[256]; 

new name[MAX_PLAYER_NAME]; 

GetPlayerName(killerid,name, sizeof(name)); 

printf("  %s kicked pentru teamkilling",name); 

Kick(killerid); 

format(string, sizeof(string), "Ai primit kick %s pentru teamkilling!",name); 

SendClientMessageToAll(COLOR_GREEN, string); 
}
return 1; 
}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.