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

Wysłany: 2012-08-23, 16:41


steo







Wiek: 42
Na forum: 5045 dni
Posty: 16
Nick w MP: steo

Piwa: 95

Respekt: 50

Ostrzeżeń: 20%
Witam, znalaz?em tutaj taki kod, na system admina ale niestety mam 2 errory :D

oto kod:


#include <a_samp>

if(PlaySound)
PlaySoundForPlayer(PlayerId, 1190);
TextDrawSetString(tdIntroDescription[PlayerId], String);
}

COMMAND:sluzba(playerid, cmdtext[])
{
if(!Player[playerid][Logged] || (!IsPlayerAdmin(playerid) && Player[playerid][Admin] < 1))
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Nie jeste? administratorem.");
return 1;
}

if(Player[playerid][OnDuty])
{
Player[playerid][OnDuty] = false;
SendClientMessage(playerid, COLOR_GREEN, " (info) Nie jeste? ju? na s?u?bie. By powr?ci? do s?u?by ponownie wpisz /sluzba .");
}
else
{
Player[playerid][OnDuty] = true;
SendClientMessage(playerid, COLOR_GREEN, " (info) Jeste? na s?u?bie. Je?li nie chcesz by? na s?u?bie ponownie wpisz /sluzba .");
}

// poni?ej dajemy admina >

if(IsPlayerConnected(PlayerId) && IsPlayerInCheckpoint(PlayerId))
return Player[PlayerId][InCPArea];
return -1;
}

COMMAND:setlevel(playerid, params[])
{
if(!IsAdmin(playerid, 2))
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Komenda dost?pna tylko dla head administratora.");
return 1;
}

new PlayerId, nLevel;
if(sscanf(params, "ud", PlayerId, nLevel))
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) U?yj: /setlevel [ID gracza] [poziom]");
return 1;
}

if(PlayerId == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Nie ma gracza o podanym ID.");
return 1;
}

if(playerid == PlayerId)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Nie mo?esz zmieni? sobie poziomu.");
return 1;
}

if(nLevel < 0 || nLevel > 2)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Podano b??dny poziom (dozwolone: 0-2).");
return 1;
}

Player[PlayerId][Admin] = nLevel;
dini_IntSet(FILE_ADMINS, udb_encode(Player[PlayerId][Name]), nLevel);

new String[255];
format(String, sizeof(String), " (info) %s (id %d) jest teraz administratorem z %d poziomem.", Player[PlayerId][Name], PlayerId, nLevel);
SendClientMessage(playerid, COLOR_GREEN, String);

return 1;
}



oto errory:


C:\Users\Kamil\Desktop\adminbysteo.pwn(3) : error 010: invalid function or declaration
C:\Users\Kamil\Desktop\adminbysteo.pwn(5) : error 021: symbol already defined: "TextDrawSetString"
C:\Users\Kamil\Desktop\adminbysteo.pwn(76) : warning 203: symbol is never used: "setlevel"
C:\Users\Kamil\Desktop\adminbysteo.pwn(76) : warning 203: symbol is never used: "sluzba"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.


My?l?, ?e to co? z kodem. Nie znam si? na tym, poniewa? wcale si? tym nie interesowa?em :D D wi?c prosz? was o pomoc. B?d? piwka.



http://pastebin.pl/65249

Ostatnio zmieniony przez steo 2012-08-23, 17:12, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-23, 16:54


B!4CK

Never give UP!






Wiek: 32
Na forum: 5809 dni
Posty: 1047
Nick w MP: John

Piwa: 1891

Respekt: 124,2
Respekt: 124,2

Wstaw kod na pastebin.pl ,
Posiadasz include pod 0.3e?

Podpis
Cześć
! :)


Projekt, który poruszy scenę platformy SA:MP!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-23, 17:13


steo







Wiek: 42
Na forum: 5045 dni
Posty: 16
Nick w MP: steo

Piwa: 95

Respekt: 50

Ostrzeżeń: 20%
"blackelegy" napisał/a:

Wstaw kod na pastebin.pl ,
Posiadasz include pod 0.3e?

Nie include mam pod 0.3d ale m?j serwer SAMP jest pod 0.3c

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-23, 17:26


__.A.__







Wiek: 30
Na forum: 5170 dni
Posty: 151

Piwa: 855

Respekt: 110
Respekt: 110

dopisz #include <zcmd>

Podpis
new map test beta:

ip serwera: 80.72.36.203:4056
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-23, 17:29


steo







Wiek: 42
Na forum: 5045 dni
Posty: 16
Nick w MP: steo

Piwa: 95

Respekt: 50

Ostrzeżeń: 20%
"__.A.__" napisał/a:

dopisz #include <zcmd>


dopisa?em i mam wi?cej error?w :D



C:\Users\Kamil\Desktop\adminbysteo.pwn(4) : error 010: invalid function or declaration
C:\Users\Kamil\Desktop\adminbysteo.pwn(6) : error 021: symbol already defined: "TextDrawSetString"
C:\Users\Kamil\Desktop\adminbysteo.pwn(11) : error 017: undefined symbol "Player"
C:\Users\Kamil\Desktop\adminbysteo.pwn(11) : warning 215: expression has no effect
C:\Users\Kamil\Desktop\adminbysteo.pwn(11) : error 001: expected token: ";", but found "]"
C:\Users\Kamil\Desktop\adminbysteo.pwn(11) : error 029: invalid expression, assumed zero
C:\Users\Kamil\Desktop\adminbysteo.pwn(11) : fatal error 107: too many error messages on one line

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


6 Errors.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-23, 18:07


Combacior







Wiek: 29
Na forum: 5795 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
Kod:

if(PlaySound)
PlaySoundForPlayer(PlayerId, 1190);
TextDrawSetString(tdIntroDescription[PlayerId], String);
}


Co to ma by? ?! Warunek poza komendami/callbackami? Usu? to

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-23, 18:15


steo







Wiek: 42
Na forum: 5045 dni
Posty: 16
Nick w MP: steo

Piwa: 95

Respekt: 50

Ostrzeżeń: 20%
"CombaT" napisał/a:

Kod:

if(PlaySound)
PlaySoundForPlayer(PlayerId, 1190);
TextDrawSetString(tdIntroDescription[PlayerId], String);
}


Co to ma by? ?! Warunek poza komendami/callbackami? Usu? to


Okey, nie wiem co to callback, Ale skasowa?em to i mam co? takiego:


C:\Users\Kamil\Desktop\adminbysteo.pwn(73) : warning 203: symbol is never used: "setlevel"
C:\Users\Kamil\Desktop\adminbysteo.pwn(73) : warning 203: symbol is never used: "sluzba"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.

Postaw piwo autorowi tego posta
 

 
Tagi: system :: administratora
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