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

Wysłany: 2013-05-19, 17:58


panmajster







Wiek: 42
Na forum: 4786 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

Witam :)

Jak zrobi?, aby po wpisaniu komendy np. /999 [swoje id] [tresc] szla informacja do medykow ze ktos ich wzywa, razem z trescia wiadomosci ?

ten kod zrobilem :

Kod:


CMD:999(playerid, params[])
{
new fd[256];
new str[256];
fd = PlayerName(playerid);

format(str, 256, "*** %s wzywa policje!", PlayerName(playerid));
SendClientMessageToAll(0x77FF77FF, str);
return 1;
}


Za pomoc daje piffka :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 18:23


xqz

otaku desu!






Wiek: 32
Na forum: 6406 dni
Posty: 723
Nick w MP: xqz

Piwa: 5465

Respekt: 418,6
Respekt: 418,6

Kod:

CMD:999(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid,-1,"Uzyj: /999 [wiadomosc]");
new str[144];
format(str, 144, "*** %s [id: %d] wzywa POGOTOWIE!: [ %s ]", PlayerName(playerid),playerid,params);
for(new i=0, f=GetMaxPlayers(); i<f; i++)
{
if(TEAM[i] == MEDYCY) //sam sobie musisz warunek zrobic
{
SendClientMessage(i,0x77FF77FF, str);
}
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 18:40


panmajster







Wiek: 42
Na forum: 4786 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

Zrobi?em aby odtwarza?o d?wi?k na danym obszarze, ale nie dzia?a. Jak dzia?a d?wi?k, to nie przychodzi wiadomo?? i na odwr?t. Oto kod :

Kod:


CMD:999(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid,-1,"Uzyj: /999 [wiadomosc]");
new str[144];
new Float:Distance = 180.0;
format(str, 144, "*** %s [id: %d] wzywa POGOTOWIE!: [ %s ]", PlayerName(playerid),playerid,params);
for(new i=0, f=GetMaxPlayers(); i<f; i++)
{
PlayAudioStreamForPlayer(i, "http://*/d*/s*.mp3", 1381.3805, 691.3820, 10.8203, Distance, 180);
{
if(ToFD(playerid))
{
SendClientMessage(i,0x77FF77FF, str);
}
}
}
return 1;
}


Co w tym jest nie tak ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 19:58


Sillence







Wiek: 26
Na forum: 5157 dni
Posty: 1514
Nick w MP: Sillence

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

panmajster Zobacz tak:
Kod:

CMD:999(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid,-1,"Uzyj: /999 [wiadomosc]");
new str[144];
new Float:Distance = 180.0;
format(str, 144, "*** %s [id: %d] wzywa POGOTOWIE!: [ %s ]", PlayerName(playerid),playerid,params);
for(new i=0, f=GetMaxPlayers(); i<f; i++)
{
if(ToFD(playerid))
{
PlayAudioStreamForPlayer(i, "http://*/d*/s*.mp3", 1381.3805, 691.3820, 10.8203, Distance, 180);
SendClientMessage(i,0x77FF77FF, str);
}
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 20:16


panmajster







Wiek: 42
Na forum: 4786 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

Nic si? nie dzieje, ani nie ma informacji ani d?wi?ku.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 20:24


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Kod:

CMD:999(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, -1, "U?yj: /999 [wiadomosc]"), 1;
new str[128];
format(str, sizeof(str), "*** %s [id: %d] wzywa POGOTOWIE!: [ %s ]", PlayerName(playerid), playerid, params);
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInRangeOfPoint(i, 180.0, pos[0], pos[1], pos[2]) PlayAudioStreamForPlayer(i, "http://*/d*/s*.mp3", pos[0], pos[1], pos[2], 180.0, true), SendClientMessage(i, 0x77FF77FF, str);
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 20:30


panmajster







Wiek: 42
Na forum: 4786 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

B??d :

Kod:


C:\Users\Prezes\Desktop\serwer truck\gamemodes\wtrp.pwn(2795) : error 001: expected token: ")", but found "-identifier-"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


Linijka :

Kod:


if(IsPlayerInRangeOfPoint(i, 180.0, pos[0], pos[1], pos[2]) PlayAudioStreamForPlayer(i, "http://worldtransrp.ct8.pl/dzwieki/syrena.mp3", pos[0], pos[1], pos[2], 180.0, true), SendClientMessage(i, 0x77FF77FF, str);


+ Nie widz? definicji dla frakcji.

Kod:


if(ToFD(playerid))


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 20:50


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Kod:

CMD:999(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, -1, "U?yj: /999 [wiadomosc]"), 1;
new str[128];
format(str, sizeof(str), "*** %s [id: %d] wzywa POGOTOWIE!: [ %s ]", PlayerName(playerid), playerid, params);
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInRangeOfPoint(i, 180.0, pos[0], pos[1], pos[2]) && ToFD(i)) PlayAudioStreamForPlayer(i, "http://*/d*/s*.mp3", pos[0], pos[1], pos[2], 180.0, true), SendClientMessage(i, 0x77FF77FF, str);
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 20:53


panmajster







Wiek: 42
Na forum: 4786 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

Ale to co poda?e? przydziela d?wi?k tam gdzie jest dany gracz, kt?ry wzywa t? pomoc. A ja chc? aby si? w??czy?o w innej pozycji podczas wezwania.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 20:56


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

"panmajster" napisał/a:

Ale to co poda?e? przydziela d?wi?k tam gdzie jest dany gracz, kt?ry wzywa t? pomoc. A ja chc? aby si? w??czy?o w innej pozycji podczas wezwania.


No to zmie? pozycj? w funkcji od nadawania d?wi?ku?

Kod:

CMD:999(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, -1, "U?yj: /999 [wiadomosc]"), 1;
new str[128];
format(str, sizeof(str), "*** %s [id: %d] wzywa POGOTOWIE!: [ %s ]", PlayerName(playerid), playerid, params);
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInRangeOfPoint(i, 180.0, pos[0], pos[1], pos[2]) && ToFD(i)) PlayAudioStreamForPlayer(i, "http://*/d*/s*.mp3", 1381.3805, 691.3820, 10.8203, 180.0, true), SendClientMessage(i, 0x77FF77FF, str);
}
return 1;
}


POLAND STRONG RUSSIA WE WAR YOU

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 21:02


panmajster







Wiek: 42
Na forum: 4786 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

Nie dzia?a to, ani nie przychodzi info ani si? d?wi?k nie w??cza.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 21:03


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

http://wiki.sa-mp.com/wik...StreamForPlayer

PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 1);

Ostatnia warto?? oznacza prawd? albo fa?sz (1 albo 0).

W Twoim przypadku by?o to 180.0 (czyli float, za pewne pomyli?e? distans z t? warto?ci?). Sprawdzaj wiki SA-MP'a. Tam jest wypis wszystkich funkcji.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 21:08


panmajster







Wiek: 42
Na forum: 4786 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

No k**** nie dzia?a, no nie dzia?a :evil: :evil: :evil:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 21:11


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Poka? funkcj? ToFD.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-19, 21:15


panmajster







Wiek: 42
Na forum: 4786 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

Kod:


stock ToFD(playerid)//SPRAWDZA CZY TO FD
{
new s=GetPlayerSkin(playerid);
if((s==278||s==279||s==211)&&PlayerInfo[playerid][gFrakcja]!=3)
{
return 1;
}
return 0;
}


O to Ci chodzi ? :P

Postaw piwo autorowi tego posta
 

 
Tagi: wezwanie :: medykow
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN 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