Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-01-03, 16:36


fensz







Wiek: 44
Na forum: 6024 dni
Posty: 25
Nick w MP: Rick_Ross



Respekt: 50

Witam, mam drobny problem ze sk?adni?.
Jak by?cie to rozwi?zali, ?eby wysy?a? do gracza normalnie na czacie wiadomo?? (Kod poni?ej si? nie kompiluje)
Kod:

GameTextForPlayer(playerid, "~g~HEADSHOT!", 2000, 0);
SCM(playerid, COLOR_GREEN, "Trafiles uzytkownika "player" prosto w leb!");
GameTextForPlayer(player, "~r~HEADSHOT!", 2000, 0);
SCM(player, COLOR_RED, "Dostales prosto w leb od "playerid);


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-01-03, 16:41


NoTa







Wiek: 31
Na forum: 5187 dni
Posty: 121

Piwa: 2

Respekt: 55

podaj public OnPlayerTakeDamage i OnPlayerGiveDamage

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-01-03, 16:47


fensz







Wiek: 44
Na forum: 6024 dni
Posty: 25
Nick w MP: Rick_Ross



Respekt: 50

Kod:

public OnPlayerGiveDamage(playerid,damagedid,Float:amount,weaponid)
{
/// if(pInfo[damagedid][DM] == 1 && pInfo[playerid][DM] == 1 && damagedid != INVALID_PLAYER_ID || gTeam[playerid] == gTeam[damagedid] || gTeam[damagedid] != TEAM_DM || gTeam[damagedid] != NO_TEAM) GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~~>~Do Not Team Attack ~<~", 1500, 4);
// if(damagedid != INVALID_PLAYER_ID || gTeam[playerid] == gTeam[damagedid] || gTeam[damagedid] != TEAM_DM || gTeam[damagedid] != NO_TEAM)
if(pInfo[playerid][DM] == 0 && gTeam[playerid] == gTeam[damagedid]) GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~~>~ Nie atakuj swoich ludzi! ~<~", 1500, 4);
return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID && gTeam[playerid] != gTeam[issuerid] || pInfo[playerid][DM] == 1) PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
if(issuerid != INVALID_PLAYER_ID && gTeam[playerid] != gTeam[issuerid] || pInfo[playerid][DM] == 1)
{
new s[20];
format(s, 10, "-DMG %.0f", amount);
TextDrawSetString(GiveDamage[playerid], s);
TextDrawShowForPlayer(playerid, GiveDamage[playerid]);
SetTimerEx("DestructTextoDraw", 1000, false, "i", playerid);
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-01-03, 16:56


NoTa







Wiek: 31
Na forum: 5187 dni
Posty: 121

Piwa: 2

Respekt: 55

A to gdzie masz u?yte ?
Kod:

GameTextForPlayer(playerid, "~g~HEADSHOT!", 2000, 0);
SCM(playerid, COLOR_GREEN, "Trafiles uzytkownika "player" prosto w leb!");
GameTextForPlayer(player, "~r~HEADSHOT!", 2000, 0);
SCM(player, COLOR_RED, "Dostales prosto w leb od "playerid);


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-01-03, 16:56


fensz







Wiek: 44
Na forum: 6024 dni
Posty: 25
Nick w MP: Rick_Ross



Respekt: 50

Kod:

stock HeadshotCheck(playerid, &Float:x, &Float:y, &Float:z)
{
new Float:fx,Float:fy,Float:fz;
GetPlayerCameraFrontVector(playerid, fx, fy, fz);

new Float:cx,Float:cy,Float:cz;
GetPlayerCameraPos(playerid, cx, cy, cz);

for(new Float:i = 0.0; i < 50; i = i + 0.5)
{
x = fx * i + cx;
y = fy * i + cy;
z = fz * i + cz;

#if defined SHOWPATH
CreatePickup(1239, 4, x, y, z, -1);
#endif

for(new player = 0; player < SERVER_MAX_PLAYERS; player ++)
{
if(IsPlayerConnected(playerid))
{
if(player != playerid)
{
if(GetPlayerSpecialAction(player) == SPECIAL_ACTION_DUCK)
{
if(IsPlayerInRangeOfPoint(player, 0.3, x, y, z))
{
GameTextForPlayer(playerid, "~g~HEADSHOT", 2000, 3);
// new String[100];
// format(String,sizeof(String),"Trafiles %s prosto w leb!", player);
// SCM(playerid, green, String);

GameTextForPlayer(player, "~r~HEADSHOT", 2000, 3);
// new String1[100];
// format(String1,sizeof(String1),"Dostales prosto w leb od %s!", playerid);
// SCM(player, red, String1);

SetPlayerHealth(player, 0.0);
CallRemoteFunction("OnPlayerDeath", "ddd", player, playerid, 34);
}
}
else
{
if(IsPlayerInRangeOfPoint(player, 0.3, x, y, z - 0.7))
{

GameTextForPlayer(playerid, "~g~HEADSHOT", 2000, 3);
GameTextForPlayer(player, "~r~HEADSHOT", 2000, 3);

SetPlayerHealth(player, 0.0);
CallRemoteFunction("OnPlayerDeath", "ddd", player, playerid, 34);
}
}
}
}
}
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-01-03, 17:22


NoTa







Wiek: 31
Na forum: 5187 dni
Posty: 121

Piwa: 2

Respekt: 55

Nie wiem ja na twoim miejscu zrobi? bym to w OnPlayerTakeDamage w 0.3z dodali cz??ci cia?a

przyk?ad z wiki na strza? z snajperki w g?ow? i od razu zabija
Kod:

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
// One shot to the head to kill with sniper rifle
SetPlayerHealth(playerid, 0.0);
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-01-03, 17:24


fensz







Wiek: 44
Na forum: 6024 dni
Posty: 25
Nick w MP: Rick_Ross



Respekt: 50

Faktycznie, nie wiedzia?em o tym. Dzi?ki!

Postaw piwo autorowi tego posta
 

 
Tagi: sendclientmessage
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [INNE] SendClientMessage Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku