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

Wysłany: 2012-02-24, 15:12


kamiloo2







Wiek: 30
Na forum: 5694 dni
Posty: 84

Piwa: 289

Respekt: 50

mam taki problem a dok?adnie mam komend? na teleport gracza 1 do gracza 2 i jest kilka error?w

Kod:


if(strcmp(cmd, "/tp", true) == 0 && IsPlayerAdmin(playerid)|| strcmp(cmd, "/tepe", true) == 0 && IsPlayerAdmin(playerid)) {
tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Admin: /Tp [ID 1 gracza] [do ID 2 gracza]");
return 1;
}
giveplayerid = strval(tmp);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Admin: /tp [ID 1 gracza] [do ID 2 gracza]");
return 1;
}
teleid = strval(tmp);

if (IsPlayerConnected(giveplayerid) && IsPlayerConnected(teleid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(teleid, telename, sizeof(telename));
GetPlayerPos(teleid, pX,pY,pZ);
new Interior;
Interior = GetPlayerInterior(teleid);
SetPlayerInterior(giveplayerid, Interior);
SetPlayerPos(giveplayerid, pX,pY,pZ);
To ta linijka-> format(string, sizeof(string), "Admin %s (id:%d) teleportowal %s (id: %d) do %s (id: %d)",PlayerName(playerid),playerid,giveplayer,giveplayerid,telename,teleid);
printf(string);
format(string, sizeof(string), "Teleportowa?e? %s do %s", giveplayer,telename);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string, sizeof(string), "Zosta?es teleportowany do %s",telename);
SendClientMessage(giveplayerid, COLOR_GREEN, string);
format(string, sizeof(string), "Teleportowano do ciebie gracza: %s",giveplayer);
SendClientMessage(teleid, COLOR_GREEN, string);
}
if (!IsPlayerConnected(giveplayerid)) {
format(string, sizeof(string), "Admin: %d nie jest aktywnym graczem.", giveplayerid);
SendClientMessage(playerid, COLOR_ADMIN, string);
}
if (!IsPlayerConnected(teleid)) {
format(string, sizeof(string), "Admin: %d nie jest aktywnym graczem.", teleid);
SendClientMessage(playerid, COLOR_ADMIN, string);
}

return 1;
}


Errory:

Kod:


(1561) : error 012: invalid function call, not a valid address
(1561) : warning 215: expression has no effect
(1561) : error 001: expected token: ";", but found ")"
(1561) : error 029: invalid expression, assumed zero
(1561) : fatal error 107: too many error messages on one line

4 Errors.


W kodzie z gamemoda zaznaczy?em linijk?: To ta linijka->

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-02-24, 15:59


MG303







Wiek: 30
Na forum: 6418 dni
Posty: 654

Piwa: 2990

Respekt: 231,6
Respekt: 231,6Respekt: 231,6

Kod:

To ta linijka-> format(string, sizeof(string), "Admin %s (id:%d) teleportowal %s (id: %d) do %s (id: %d)",PlayerName(playerid),playerid,giveplayer,giveplayerid,telename,teleid);
printf(string);


usu? to, to i tak nie jest potrzebne, tylko wysy?a informacje do konsoli ;p

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-02-24, 18:13


kamiloo2







Wiek: 30
Na forum: 5694 dni
Posty: 84

Piwa: 289

Respekt: 50

a da si? to naprawi? ? (pytam na zapas)

Postaw piwo autorowi tego posta
 

 
Tagi: komenda :: admina
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] Komenda admina 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