Wysłany: 2013-02-25, 17:39
adalus1995
Wiek: 31 Na forum: 4893 dni Posty: 102
Piwa : 2
Siema, mam pro?be
Mo?ecie dla mnie znale?? z jakiego? ?r?d?a
komende np :
/do [tresc]
widz? wtedy to gracze w zakresie 20 m
to samo /me
widz? wtedy to gracze w zakresie 20 m
Bo nie moge znalec, pytalem sie wojka google ale nic.
Wysłany: 2013-02-25, 18:00
Quis
Wszechwiedzący
Wiek: 31 Na forum: 5146 dni Posty: 464
Nick w MP: Quis
Piwa : 1110
Musisz utworzy? tak? p?tl? w komendzie:
Kod: new Float:pPos[3];
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 20.0, pPos[0], pPos[1], pPos[2]))
{
//je?li jest w zasi?gu, tutaj wstawiasz kod (jako ID gracza podajesz 'i')
}
}
}
No i co do reszty, to wczytujesz dane z komendy (params, albo strtok), pobierasz nazw? gracza, wstawiasz do ci?gu znak?w razem z danymi z komendy i wy?wietlasz w p?tli w danym kolorze u?ywaj?c SendClientMessage. I jeszcze co?: raczej nikt nie b?dzie tego szuka? na necie, skoro to 5 minut roboty
Pozdrawiam
Wysłany: 2013-02-25, 18:03
adalus1995
Wiek: 31 Na forum: 4893 dni Posty: 102
Piwa : 2
Wysłany: 2013-02-25, 18:09
B!4CK
Never give UP!
Wiek: 32 Na forum: 5809 dni Posty: 1047
Nick w MP: John
Piwa : 1891
Og?lnie komenda wygl?da tak :
Kod: //----------------------------------[Emote]-----------------------------------------------
if(strcmp(cmd, "/ja", true) == 0 || strcmp(cmd, "/me", true) == 0 || strcmp(cmd, "*", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Nie jeste? zalogowany !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "U?yj: /ja [akcja]");
return 1;
}
format(string, sizeof(string), "* %s %s", sendername, result);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
}
return 1;
}
//----------------------------------[Emote]-----------------------------------------------
if(strcmp(cmd, "/do", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Nie jeste? zalogowany !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "U?yj: /do [akcja]");
return 1;
}
format(string, sizeof(string), "* %s ((%s))", result, sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
}
return 1;
}
Podpis
Cześć
[you]
!
Projekt, który poruszy scenę platformy SA:MP!
Wysłany: 2013-02-25, 20:58
adalus1995
Wiek: 31 Na forum: 4893 dni Posty: 102
Piwa : 2
Kod: //-----------------ME-------DZIA?A
if (strcmp(cmd, "/me", true)==0){
strmid(mpt,cmdtext,3,strlen(cmdtext));
if(!strlen(mpt)) {
SendClientMessage(playerid, COLOR_YELLOW, "/me [text]");
return 1;
}
format(string, sizeof(string), "%s%s",PlayerName(playerid), mpt);
ProxDetector(30.0, playerid, string, COLOR_BLUE,COLOR_BLUE,COLOR_BLUE,COLOR_BLUE,COLOR_BLUE);
return 1;
}
Mo?e inaczej, jak to przerobi??
Aby widzieli to w zakresie 20 m?
Bo to ca?y serwer widzi.
Wysłany: 2013-03-02, 15:46
Patro114
Wiek: 34 Na forum: 4877 dni Posty: 113
Piwa : 993
znajd? w mapie "/do" i to jest chyba na 15 m xd (Mapa PTR)
Wysłany: 2013-03-02, 17:40
adalus1995
Wiek: 31 Na forum: 4893 dni Posty: 102
Piwa : 2
Ju? mam od wczoraj
Znaczy si? zrobi?em sam.
Tagi: /do :: /me
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: