[POMOC]/PM

Započeo ‹Fox›, Avgust 26, 2010, 19:37:51 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

moze li mi ko dati FS sa komandom /PM zato sto uvijek kad radim po nekom tutu uvijek neki errori i tak...pa ako neko ima FS sa /PM ili da neko nnapravi...bit cu vam zahvalan...

Evo, i obavezno izmeni textove ... XD

Napomena, komanda je preuzeta od ravenovog rpa


if(strcmp(cmd, "/pm", true) == 0) // By CuervO_NegrO
{
   if(IsPlayerConnected(playerid))
   {
       if(gPlayerLogged[playerid] == 0)
       {
           SendClientMessage(playerid, COLOR_GREY, "Oj sine, nisi logiran!");
           return 1;
       }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Ma koristi ovako komandu: /pm [id igraca/deo nicka] [text]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
   if(giveplayerid != INVALID_PLAYER_ID)
   {
       if(HidePM[giveplayerid] > 0)
       {
           SendClientMessage(playerid, COLOR_GREY, "** Hah! Taj igrac te je zajebo i blokirao je PMove!");
           return 1;
       }
          if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Alo ba, ti bi da pises? Epa, ne moze sinko, ucutkan si!");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
new h, mi, s;
new y1, m, d;
gettime(h,mi,s);
getdate(y1, m, d);
if(giveplayerid == playerid)
{
format(string, sizeof(string), "* %s je ret*rd i prica sam sa sobom.", sendername);
ProxDetector(5.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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, "Ma koristi ovako komandu: (/pm) [id igraca/deo nicka] [text]");
return 1;
}
format(string, sizeof(string), "* Stigao je novi PM od %s (%d): %s", sendername, playerid, (result));
SendClientMessage(giveplayerid, 0xE5C43EAA, string);
PlayerPlaySound(giveplayerid, 1055, x,y,z);
format(string, sizeof(string), "* Uspesno poslat PM plejeru %s (%d): %s", giveplayer, giveplayerid, (result));
SendClientMessage(playerid, 0xBBA033AA, string);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [PM] to %s: (%s)",d,m,y1,h,mi,s, sendername,giveplayer, result);
PMLog(string);
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pViewPms] == 1 && PlayerInfo[i][pAdmin] >= 1)
{
                       format(string, sizeof(string), "[INFO] %s (%d) je poslao PM ovom liku %s (%d) - (%s)",sendername, playerid, giveplayer, giveplayerid, (result));
                       SendClientMessage(i, COLOR_LIGHTRED, string);
}
}
}
return 1;
}
}
else
{
format(string, sizeof(string), "  Zelis poslati PM IDu %d? Steta, nije online .", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Poslednja Izmena: Avgust 27, 2010, 00:39:42 PRE PODNE od mikec

CitatEvo, i obavezno izmeni textove ... XD

Napomena, komanda je preuzeta od ravenovog rpa

Hahha! Textovi otkidaju! xDD

nastoe

Citat: Marjan_King poslato Avgust 27, 2010, 00:36:20 PRE PODNE
CitatEvo, i obavezno izmeni textove ... XD

Napomena, komanda je preuzeta od ravenovog rpa

Hahha! Textovi otkidaju! xDD
Spanji spam

Nisam se niti nado drugacijem rezultatu nego tipicni strcmp -.-

opet neki errori aj mi napravi FS sa tom komandom a ne ovako, ovako nsta nemogu uvijek errori

errori..pa postaj te errore..da se vidi sta je..

D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(862) : warning 219: local variable "string" shadows a variable at a preceding level
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(872) : warning 219: local variable "string" shadows a variable at a preceding level
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(882) : warning 219: local variable "string" shadows a variable at a preceding level
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(890) : warning 219: local variable "string" shadows a variable at a preceding level
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(917) : warning 219: local variable "string" shadows a variable at a preceding level
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1056) : error 017: undefined symbol "cmd"
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1060) : error 017: undefined symbol "gPlayerLogged"
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1060) : warning 215: expression has no effect
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1060) : error 001: expected token: ";", but found "]"
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1060) : error 029: invalid expression, assumed zero
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1060) : fatal error 107: too many error messages on one line

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


5 Errors.


1056-a linija:
if(strcmp(cmd, "/pm", true) == 0) // By CuervO_NegrO
1060-a linija:
if(gPlayerLogged[playerid] == 0)

On ti je dao promjer ti sam napravi komandu, nemozes bilo koju komandu kopirati u mod i da radi sama od sebe.


RESPECT 4 EVER: John, GLC,bAndzi, Nikola, Sop, Zoki, Bruno_Venuti, Mele, Luka P,ExtremePower,Wang(neki kineski frajer)

NAJBOLJI CITATI:
Citat: [GF]Alive poslato Jun 24, 2010, 18:20:19 POSLE PODNE
Paizte ljud mozda je KayLoger! ! !
MOJI RADOVI:
[FS]Trofeji

Citat: LordShigi poslato Avgust 27, 2010, 13:24:36 POSLE PODNE
On ti je dao promjer ti sam napravi komandu, nemozes bilo koju komandu kopirati u mod i da radi sama od sebe.
a jbga...jel se mogu rijesit ovi errori?

Ma sve se može rešiti, ako nešto nemaš, dodaj to, ili izbriši taj deo iz skripte.

Ne očekujete valjda da ću vam sve uraditi 100%.




Citat: [ST]DeFox poslato Avgust 27, 2010, 12:21:00 POSLE PODNE
opet neki errori aj mi napravi FS sa tom komandom a ne ovako, ovako nsta nemogu uvijek errori

Bolje je komande raditi u GM nego u FS.



Citat: [ST]DeFox poslato Avgust 27, 2010, 13:16:47 POSLE PODNE
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(862) : warning 219: local variable "string" shadows a variable at a preceding level
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(872) : warning 219: local variable "string" shadows a variable at a preceding level
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(882) : warning 219: local variable "string" shadows a variable at a preceding level
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(890) : warning 219: local variable "string" shadows a variable at a preceding level
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(917) : warning 219: local variable "string" shadows a variable at a preceding level
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1056) : error 017: undefined symbol "cmd"
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1060) : error 017: undefined symbol "gPlayerLogged"
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1060) : warning 215: expression has no effect
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1060) : error 001: expected token: ";", but found "]"
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1060) : error 029: invalid expression, assumed zero
D:\mario dokumenti2\streamer\streamed\gamemodes\multitestt.pwn(1060) : fatal error 107: too many error messages on one line

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


5 Errors.


1056-a linija:
if(strcmp(cmd, "/pm", true) == 0) // By CuervO_NegrO
1060-a linija:
if(gPlayerLogged[playerid] == 0)

cmd, u početak dogaÄ'aja OnPlayerCommandText dodaj ovo:
new cmd = strtok(cmdtext, idx);

A koliko mi se čini, možeš staviti i;
if(!strcmp(cmdtext, "/pm", true))

Kod ovog drugog, ne moraš dodati ništa, samo zameni taj red sa ovime.


A za 1060 liniju, imaš dve opcije, da izbrišeš:
if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "Oj sine, nisi logiran!");
            return 1;
        }


ili da definišeš gPlayerLogged.
Ako se odlučiš za drugu opciju, gore kod deklarisanja novih promenjivih, dodaj:
new gPlayerLogged[MAX_PLAYERS];
DogaÄ'aj OnPlayerConnect:
gPlayerLogged[playerid] = 0;
Kada se igrač logira, staviš:
gPlayerLogged[playerid] = 1;

I to bi trebalo biti to. Malo se potrudite da shvatite šta se tamo dešava i da na osnovu toga nešto sredite.


Evo i ako nekom treba za admin pm prevedeno...


if(strcmp(cmd, "/odgovori", true) == 0 || strcmp(cmd, "/odgovori", true) == 0) // By CuervO_NegrO edit David
{
    if(IsPlayerConnected(playerid))
    {
if (PlayerInfo[playerid][pAdmin] >= 1)
{
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Jos nisi loginovan/na!");
            return 1;
        }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /odgovori [ID/Deo imena] [Tekst]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new h,mi,s;
      new y,m,d;
gettime(h,mi,s);
getdate(y,m,d);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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, "KORISTI: /odgovori [ID/Deo imena] [Tekst]");
return 1;
}
format(string, sizeof(string), "* Odgovor od admina: %s", (result));
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Odgovor poslat do %s (%d): %s", giveplayer, giveplayerid, (result));
SendClientMessage(playerid,  COLOR_GREEN, string);
format(string, sizeof(string), "[ADMIN]: %s Administrator je poslao odgovor %s (%d) (Tekst: %s).",sendername,giveplayer,giveplayerid, (result));
SendAdminMessage(COLOR_LIGHTRED,string);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [Odgovor] do %s: (%s)",d,m,y,h,mi,s, sendername,giveplayer, result);
APMLog(string);
return 1;
}
}
else
{
format(string, sizeof(string), "   %d nije na serveru.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
}