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

Wysłany: 2013-05-29, 15:02


panmajster







Wiek: 42
Na forum: 4787 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

Witajcie.

Jak zrobi? w tym kodzie, aby gracz kt?ry np. jest we frakcji "V.I.P" m?g? bra? wi?cej towaru ni? reszta, podczas gdy w?a?nie reszta mo?e tylko 10 ton ?

kodzik :

Kod:


if(dialogid == T_DIALOG)
{
if(response)
{
new ID,
str[128];
switch(listitem)
{
case 0: ID = GetPVarInt(playerid, "Zlecenie#1");
case 1: ID = GetPVarInt(playerid, "Zlecenie#2");
case 2: ID = GetPVarInt(playerid, "Zlecenie#3");
}
SetPVarInt(playerid, "T_Zlecenie", ID);
Zlecenie[playerid] = ID;
SetPlayerMapIcon(playerid, 99, Truck_Pos[ID][0], Truck_Pos[ID][1], Truck_Pos[ID][2], 51, 0, MAPICON_GLOBAL_CHECKPOINT);
SendClientMessage(playerid, KOLOR, "Za?aduj towar w zaznaczonym miejscu na mapie");
new id = GetPVarInt(playerid, "T_Zlecenie");
TextDrawHideForPlayer(playerid, T_TD[playerid][1]);
TextDrawShowForPlayer(playerid, T_TD[playerid][0]);
format(str, sizeof str, "~w~Dostarcz: ~y~%s ~n~~w~z: ~r~%s ~n~~w~do: ~g~%s", Truck_Lista[id][0], Truck_Lista[id][2], Truck_Lista[id][3]);
TextDrawSetString(T_TD[playerid][0], str);
}
}
if(dialogid == T_DIALOG+1)
{
if(response)
{
SetPVarInt(playerid, "T_Block", 0);
if(!IsNumeric(inputtext))
{
ShowPlayerDialog(playerid, T_DIALOG+1, DIALOG_STYLE_INPUT, "?adowanie towaru", "Wpisz ile ton chcesz przetransportowa? (max. 10 [vip max. 30]):", "OK", "Anuluj");
return 1;
}
if(1 > strval(inputtext) || strval(inputtext) > 10 || !strlen(inputtext)) // Ilosc ton
{
SendClientMessage(playerid, KOLOR, "Nie mo?esz za?adowa? wi?cej ni? 10 ton");
ShowPlayerDialog(playerid, T_DIALOG+1, DIALOG_STYLE_INPUT, "?adowanie towaru", "Wpisz ile ton chcesz przetransportowa? (max. 10 [vip max. 30]):", "OK", "Anuluj");
return 1;
}
SendClientMessage(playerid, KOLOR, "Czekaj trwa ?adowanie towaru...");
SetPVarInt(playerid, "T_Block", 1);
SetPVarInt(playerid, "T_Ton", strval(inputtext));
SetPVarInt(playerid, "T_Timer", SetTimerEx("T_Laduj", 1000, 1, "dd", playerid, GetPlayerVehicleID(playerid)));
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-29, 16:17


Wafelowski







Wiek: 29
Na forum: 5348 dni
Posty: 428

Piwa: 100

Respekt: 232
Respekt: 232Respekt: 232

... Wystarczy doda? warunek. Pisa?em w poprzednim Twoim temacie.

Musisz da? warunek je?eli nie jestem VIP'em to mo?e te 10 TON je?eli jest czyli else if(Vip[playerid]) (czy jak to tam sprawdzasz). i potem tutaj

Kod:

if(1 > strval(inputtext) || strval(inputtext) > 30 || !strlen(inputtext)) // Ilosc ton
- Zmieniasz na 30, czyli Warunek i else. Tyle roboty. Pog??wkuj troch? a nie bo mi si? nie chce na forum mi to napiszo in?yniery jedne.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-29, 17:14


panmajster







Wiek: 42
Na forum: 4787 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

Dobrze ? :

Kod:


if(dialogid == T_DIALOG)
{
if(response)
{
new ID,
str[128];
switch(listitem)
{
case 0: ID = GetPVarInt(playerid, "Zlecenie#1");
case 1: ID = GetPVarInt(playerid, "Zlecenie#2");
case 2: ID = GetPVarInt(playerid, "Zlecenie#3");
}
SetPVarInt(playerid, "T_Zlecenie", ID);
Zlecenie[playerid] = ID;
SetPlayerMapIcon(playerid, 99, Truck_Pos[ID][0], Truck_Pos[ID][1], Truck_Pos[ID][2], 51, 0, MAPICON_GLOBAL_CHECKPOINT);
SendClientMessage(playerid, KOLOR, "Za?aduj towar w zaznaczonym miejscu na mapie");
new id = GetPVarInt(playerid, "T_Zlecenie");
TextDrawHideForPlayer(playerid, T_TD[playerid][1]);
TextDrawShowForPlayer(playerid, T_TD[playerid][0]);
format(str, sizeof str, "~w~Dostarcz: ~y~%s ~n~~w~z: ~r~%s ~n~~w~do: ~g~%s", Truck_Lista[id][0], Truck_Lista[id][2], Truck_Lista[id][3]);
TextDrawSetString(T_TD[playerid][0], str);
}
}
if(dialogid == T_DIALOG+1)
{
if(response)
{
SetPVarInt(playerid, "T_Block", 0);
if(!IsNumeric(inputtext))
{
ShowPlayerDialog(playerid, T_DIALOG+1, DIALOG_STYLE_INPUT, "?adowanie towaru", "Wpisz ile ton chcesz przetransportowa? (max. 10 [vip max. 30]):", "OK", "Anuluj");
return 1;
}
if(1 > strval(inputtext) || strval(inputtext) > 10 || !strlen(inputtext))
{
SendClientMessage(playerid, KOLOR, "Nie mo?esz za?adowa? wi?cej ni? 10 ton");
ShowPlayerDialog(playerid, T_DIALOG+1, DIALOG_STYLE_INPUT, "?adowanie towaru", "Wpisz ile ton chcesz przetransportowa? (max. 10 [vip max. 30]):", "OK", "Anuluj");
return 1;
}
else
{
if(PlayerInfo[playerid][gPremium]!=1)
if(1 > strval(inputtext) || strval(inputtext) > 30 || !strlen(inputtext))
SendClientMessage(playerid, KOLOR, "Czekaj trwa ?adowanie towaru...");
SetPVarInt(playerid, "T_Block", 1);
SetPVarInt(playerid, "T_Ton", strval(inputtext));
SetPVarInt(playerid, "T_Timer", SetTimerEx("T_Laduj", 1000, 1, "dd", playerid, GetPlayerVehicleID(playerid)));
return 1;
}
}
return 1;
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-29, 18:47


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Sprawd? czy dzia?a potem si? pytaj czy dobrze.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-29, 18:53


panmajster







Wiek: 42
Na forum: 4787 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

Nie mog? sprawdzi? czy dobrze bo mam problem z tym > http://gtao.pl/inne-vip-na-czas-vt80469.htm , dlatego pytam.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-29, 18:56


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

No to patrz do tematu z Vipem. Zaraz jaki? Anio? ?wi?ty nama?ci Ci? naprawionym kodem.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-30, 17:32


panmajster







Wiek: 42
Na forum: 4787 dni
Posty: 154
Nick w MP: NieWazne

Piwa: 124

Respekt: 50

Zrobi?em taki systemik :

Kod:


if(dialogid == T_DIALOG+1)
{
if(response)
{
SetPVarInt(playerid, "T_Block", 0);
if(!IsNumeric(inputtext))
{
ShowPlayerDialog(playerid, T_DIALOG+1, DIALOG_STYLE_INPUT, "?adowanie towaru", "Wpisz ile ton chcesz przetransportowa? (max. 10 [vip max. 30]):", "OK", "Anuluj");
return 1;
}
if(1 > strval(inputtext) || strval(inputtext) > 10 || !strlen(inputtext))
{
SendClientMessage(playerid, KOLOR, "Nie mo?esz za?adowa? wi?cej ni? 10 ton");
ShowPlayerDialog(playerid, T_DIALOG+1, DIALOG_STYLE_INPUT, "?adowanie towaru", "Wpisz ile ton chcesz przetransportowa? (max. 10 [vip max. 30]):", "OK", "Anuluj");
return 1;
}
else
{
if(PlayerInfo[playerid][gPremium]==1)
if(10 > strval(inputtext) || strval(inputtext) > 30 || !strlen(inputtext))
SendClientMessage(playerid, KOLOR, "Czekaj trwa ?adowanie towaru...");
SetPVarInt(playerid, "T_Block", 1);
SetPVarInt(playerid, "T_Ton", strval(inputtext));
SetPVarInt(playerid, "T_Timer", SetTimerEx("T_Laduj", 1000, 1, "dd", playerid, GetPlayerVehicleID(playerid)));
return 1;
}
}


Ale gdy gracz z kontem vip wybiera towar od 10 do 30 to te? mu pisze ?e nie mo?e tyle wybra?, gdy? przekracza limit. Jak zrobi? aby konto vip mog?o bra? wi?cej ni? zwyk?e ?

Postaw piwo autorowi tego posta
 

 
Tagi: dla :: vipa :: dla :: gracza
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] dla vipa - dla gracza 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