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

Wysłany: 2012-09-18, 22:34


Jablecznik

;*






Wiek: 26
Na forum: 5291 dni
Posty: 43
Nick w MP: Emilio Cavallaro

Piwa: 138

Respekt: 50

Witam. mam o to takie cos

Kod:

if(!strcmp(cmd, "/asapd", true) && IsPlayerAdmin(playerid) == 1){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, KOLOR_SZARY,"U?yj: /asapd [haslo]");
pdek = udb_hash(tmp);
dini_IntSet(PL,"pdhaslo",udb_hash(tmp));
format(string,256,"Haslo PD to: %s.",tmp);
SendClientMessage(playerid,KOLOR_SZARY,string);
return true;
}
if(!strcmp(cmd, "/sapd", true)){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, KOLOR_SZARY,"U?yj: /sapd [haslo]");
if(udb_hash(tmp)==pdek){
PD[playerid]=1;
SendClientMessage(playerid, KOLOR_SZARY,"Wszedles na slu?be SAPD.");
}else
return true;
}


ustalam haslo i loguje, ale jak zrobic, zeby zapisac haslo,czyli,, ja jako admin wpisze /asapd kloc i zeby po restarcie servera drugi raz sie nie logowac na adma i nie ustalac hasla, zapisac je, zeby odrazu sie zalogwac nim. I drugie

Kod:


new pdt;


public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == pdt)
{
if(PD[playerid])
{
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}


oskryptowanie auta mam, dodaje je do mapy, ustalam pdt = addstaticvehicleex i dalej tam auto, nie ma errorow, nie mam warningow, a nie musze byc pdkiem by wsiadac do auta, nie wywala nic ;/ nie dziala. Pomozecie? Zimne :piwo: :piwo: :piwo: :piwo: stawiam.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-22, 10:43


Sillence







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

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

Co do drugiego to zobacz :
Kod:

new pdt;


public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == pdt)
{
if(!PD[playerid])
{
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-22, 18:29


Jablecznik

;*






Wiek: 26
Na forum: 5291 dni
Posty: 43
Nick w MP: Emilio Cavallaro

Piwa: 138

Respekt: 50

"_FasteR_" napisał/a:

Co do drugiego to zobacz :
Kod:

new pdt;


public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == pdt)
{
if(!PD[playerid])
{
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}


juz widze, nie bylo wykrzyknika :D . Dzieki, dziala. A umiesz zrobic 1 ? :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-22, 20:20


Sillence







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

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

A co do tego 1 to te has?o zapisujesz w jakim? pliku czy co ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-23, 08:10


Jablecznik

;*






Wiek: 26
Na forum: 5291 dni
Posty: 43
Nick w MP: Emilio Cavallaro

Piwa: 138

Respekt: 50

"_FasteR_" napisał/a:

A co do tego 1 to te has?o zapisujesz w jakim? pliku czy co ?


Kod:

if(!strcmp(cmd, "/asapd", true) && IsPlayerAdmin(playerid) == 1){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid,KOLOR_SZARY,"U?yj: /asapd [haslo]");
pdek = udb_hash(tmp);
dini_IntSet(PL,"haslo2",udb_hash(tmp));
format(string,256,"Haslo PD to >> %s <<",tmp);
SendClientMessage(playerid,KOLOR_SZARY,string);
return true;
}
if(!strcmp(cmd, "/sapd", true)){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, BIALY,"U?yj: /sapd [haslo]");
if(udb_hash(tmp)==pdek){
PD[playerid]=1;
SendClientMessage(playerid,KOLOR_SZARY,"Zalogowa?e? si? na PD.");
}else
return true;
}



define mam

Kod:

#define PL "Haslomoderatorow.txt"



i w scriptfiled haslomoderatorow. Ustawiam haslo zapisuje sie w tym pliku, ale zauwazylem, ze zapisuje, ale nie wczytuje komenda. Poomozesz?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-23, 11:17


Sillence







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

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

Zamie? t? drug? komend? na tak? :
Kod:


if(!strcmp(cmd, "/sapd", true)){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, BIALY,"U?yj: /sapd [haslo]");
if(!strcmp(dini_Get(PL, "haslo2")) == udb_hash(tmp))(
PD[playerid]=1;
SendClientMessage(playerid,KOLOR_SZARY,"Zalogowa?e? si? na PD.");
}else{
SendClientMessage(playerid,KOLOR_SZARY,"Poda?e? b??dne has?o");
return true;
}


Nie testowa?em, ale powinno by? gut ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-23, 20:26


Jablecznik

;*






Wiek: 26
Na forum: 5291 dni
Posty: 43
Nick w MP: Emilio Cavallaro

Piwa: 138

Respekt: 50

"_FasteR_" napisał/a:

Zamie? t? drug? komend? na tak? :
Kod:


if(!strcmp(cmd, "/sapd", true)){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, BIALY,"U?yj: /sapd [haslo]");
if(!strcmp(dini_Get(PL, "haslo2")) == udb_hash(tmp))(
PD[playerid]=1;
SendClientMessage(playerid,KOLOR_SZARY,"Zalogowa?e? si? na PD.");
}else{
SendClientMessage(playerid,KOLOR_SZARY,"Poda?e? b??dne has?o");
return true;
}


Nie testowa?em, ale powinno by? gut ;)


Kod:

C:\Users\Mama\Desktop\Server\filterscripts\Systemfrakcji.pwn(74) : warning 202: number of arguments does not match definition
C:\Users\Mama\Desktop\Server\filterscripts\Systemfrakcji.pwn(74) : warning 213: tag mismatch
C:\Users\Mama\Desktop\Server\filterscripts\Systemfrakcji.pwn(74 -- 75) : error 001: expected token: ")", but found ";"

Kod:



74
if(!strcmp(dini_Get(PL, "haslo2")) == udb_hash(tmp))(


75
Kod:

PD[playerid]=1;


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-23, 21:01


Sillence







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

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

A tak ? :
Kod:

if(!strcmp(cmd, "/sapd", true)){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, ORANGE,"U?yj: /sapd [haslo]");
if(strval(dini_Get(PL, "haslo2")) == udb_hash(tmp))
PD[playerid]=1;
SendClientMessage(playerid,ORANGE,"Zalogowa?e? si? na PD.");
}else{
SendClientMessage(playerid,RED,"Poda?e? b??dne has?o");
return true;
}
return 0;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-23, 21:39


Combacior







Wiek: 29
Na forum: 5795 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
Kod:

if(!strcmp(cmd, "/sapd", true))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE,"U?yj: /sapd [haslo]");
if(strval(dini_Get(PL, "haslo2")) == udb_hash(tmp))
{
PD[playerid]=1;
SendClientMessage(playerid,ORANGE,"Zalogowa?e? si? na PD.");
return 1;
}
else return SendClientMessage(playerid,RED,"Poda?e? b??dne has?o");
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-23, 22:12


Jablecznik

;*






Wiek: 26
Na forum: 5291 dni
Posty: 43
Nick w MP: Emilio Cavallaro

Piwa: 138

Respekt: 50

"CombaT" napisał/a:

Kod:

if(!strcmp(cmd, "/sapd", true))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE,"U?yj: /sapd [haslo]");
if(strval(dini_Get(PL, "haslo2")) == udb_hash(tmp))
{
PD[playerid]=1;
SendClientMessage(playerid,ORANGE,"Zalogowa?e? si? na PD.");
return 1;
}
else return SendClientMessage(playerid,RED,"Poda?e? b??dne has?o");
}


uzylem tego i dziala, dzieki ; ). A jak zrobic komende na wylogowywanie ? :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-23, 22:19


Combacior







Wiek: 29
Na forum: 5795 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
Kod:

if(!strcmp(cmd, /logout, true))
{
if(PD[playerid] != 1) return SendClientMessage(playerid, -1, "Nie jeste? zalogowany");
PD[playerid] = 0;
SendClientMessage(playerid, -1, "Wylogowa?e? si?");
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-23, 22:32


Jablecznik

;*






Wiek: 26
Na forum: 5291 dni
Posty: 43
Nick w MP: Emilio Cavallaro

Piwa: 138

Respekt: 50

"CombaT" napisał/a:

Kod:

if(!strcmp(cmd, /logout, true))
{
if(PD[playerid] != 1) return SendClientMessage(playerid, -1, "Nie jeste? zalogowany");
PD[playerid] = 0;
SendClientMessage(playerid, -1, "Wylogowa?e? si?");
return 1;
}

dziala dzieki.

Postaw piwo autorowi tego posta
 

 
Tagi: zapisanie :: sie :: hasla :: frakcji :: oskryptowanie :: auta :: nie :: dziala
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