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

Wysłany: 2014-02-21, 21:14


carl0987







Wiek: 37
Na forum: 4891 dni
Posty: 295
Nick w MP: Lolek

Piwa: 10

Respekt: 50

Witajcie.
Nie ma wybiera?ki chocia? j? zrobi?em.
Nie mam pomys?u co to.
Kod:
Kod:

#include <a_samp>
#include <zcmd>
#include <core>
#include <float>

//Realny czas by Lolek(?ukasz Pikacz)
new Text:txtTimeDisp;
new hour, minute;
new timestr[32];
forward UpdateTimeAndWeather();
new fine_weather_ids[] = {1,2,3,4,5,6,7,12,13,14,15,17,18,24,25,26,27,28,29,30,40};
new foggy_weather_ids[] = {9,19,20,31,32};
new wet_weather_ids[] = {8};

#pragma tabsize 0
#define PocketMoney 21000
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA

//realny czas by Lolek(?ukasz Pikacz)
stock UpdateWorldWeather()
{
new next_weather_prob = random(100);
if(next_weather_prob < 70) SetWeather(fine_weather_ids[random(sizeof(fine_weather_ids))]);
else if(next_weather_prob < 95) SetWeather(foggy_weather_ids[random(sizeof(foggy_weather_ids))]);
else SetWeather(wet_weather_ids[random(sizeof(wet_weather_ids))]);
}



main()
{
print("\n----------------------------------");
print(" Uruchomiono Map? Truck\n");
print(" Stworzana przez");
print(" Lolek(?ukasz_Pikacz)");
print("----------------------------------\n");
}

public OnPlayerConnect(playerid)
{
gettime(hour, minute);
SetPlayerTime(playerid,hour,minute);
return 1;
}

public OnPlayerDisconnect(playerid)
{
return 1;
}
public OnPlayerSpawn(playerid)
{

TextDrawShowForPlayer(playerid,txtTimeDisp);

gettime(hour, minute);
SetPlayerTime(playerid,hour,minute);
GivePlayerMoney(playerid, PocketMoney);
SetPlayerInterior(playerid,0);
return 1;
}





public OnGameModeInit()
{
SetGameModeText("Truck Mapa v1.0");//nazwa mapy
txtTimeDisp = TextDrawCreate(605.0,25.0,"00:00");
TextDrawUseBox(txtTimeDisp, 0);
TextDrawFont(txtTimeDisp, 3);
TextDrawSetShadow(txtTimeDisp,0); // no shadow
TextDrawSetOutline(txtTimeDisp,2); // thickness 1
TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
TextDrawColor(txtTimeDisp,0xFFFFFFFF);
TextDrawAlignment(txtTimeDisp,3);
TextDrawLetterSize(txtTimeDisp,0.5,1.5);

UpdateTimeAndWeather();
SetTimer("UpdateTimeAndWeather",1000 * 60,1);

AddPlayerClass(265,1958.3783,1343.1572,15.3746,0,0,0,0,0,0,0);
AddPlayerClass(233, 1399.202, 985.272, 10.914,0,0,0,0,0,0,0); //TruckersLV 2
AddPlayerClass(223, -1514.9832, 700.6782, 8.339, 0,0,0,0,0,0,0); //TruckersSF 3
return 1;
}

forward SetupPlayerForClassSelection(playerid);
public SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,0);
SetPlayerFacingAngle(playerid, 149);
SetPlayerPos(playerid,-149.5167, -373.5816, 1.2031);
SetPlayerCameraPos(playerid,-151.2793, -377.5047, 1.8664);
SetPlayerCameraLookAt(playerid,-149.5167, -373.5816, 1.2031);
}
public UpdateTimeAndWeather()
{
// Update time
gettime(hour, minute);

format(timestr,32,"%02d:%02d",hour,minute);
TextDrawSetString(txtTimeDisp,timestr);
SetWorldTime(hour);

new x=0;
while(x!=MAX_PLAYERS) {
if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {
SetPlayerTime(x,hour,minute);
}
x++;
}

/* Update weather every hour
if(last_weather_update == 0) {
UpdateWorldWeather();
}
last_weather_update++;
if(last_weather_update == 60) {
last_weather_update = 0;
}*/
return 1;
}
//jak gracz dednie:
public OnPlayerDeath(playerid, killerid, reason)
{

TextDrawHideForPlayer(playerid,txtTimeDisp);
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-21, 21:47


Sillence







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

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

Moje magiczne zdolno?ci podpowiadaj? mi, ze brakuje tu:
http://wiki.sa-mp.com/wiki/OnPlayerRequestClass
oraz
http://wiki.sa-mp.com/wiki/OnPlayerRequestSpawn

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 09:25


carl0987







Wiek: 37
Na forum: 4891 dni
Posty: 295
Nick w MP: Lolek

Piwa: 10

Respekt: 50

Ahh g?upi ja. Tak to jest jak si? przerw? w pawno robi (tu si? zapomni tu ?le zrobi.)
zrobi?em tak:
Kod:

public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}

i dzia?a dzi?ki piffko leci :)

ale jest teraz problem z k?tem.
daje tak:
Kod:

SetPlayerInterior(playerid,0);
SetPlayerFacingAngle(playerid, 149);
SetPlayerPos(playerid,-149.5167, -373.5816, 1.2031);
SetPlayerCameraPos(playerid,-151.2793, -377.5047, 1.8664);
SetPlayerCameraLookAt(playerid,-149.5167, -373.5816, 1.2031);


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 10:17


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

Jak dobrze pamietam to

Pawn

SetPlayerFacingAngle(playerid149); 


Pobaw si? t? liczb? :P

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 10:50


=X=

WUJCIO DOBRA RADA






Wiek: 52
Na forum: 4524 dni
Posty: 134
SPONSOR

Piwa: 641

Respekt: 209,5
Respekt: 209,5Respekt: 209,5

Ostrzeżeń: 100%
"ToxiC`" napisał/a:

Jak dobrze pamietam to

Pawn

SetPlayerFacingAngle(playerid149); 


Pobaw si? t? liczb? :P


ToxiC, z ca?ym szacunkiem nic to mu nie da, poniewa? jest to obr?t skina x, y, z - w danej lokalizacji ;) . Bo z tego co pisz? chodzi mu o k?t kamery prawdopodobnie, chyba ?e si? myl? i chce ustawi? x, y, z skina do kamery.

Ps. carl0987, wypowiedz si? precyzyjnie o jaki k?t ci chodzi - czytaj w/w temat.

Pawn

public OnPlayerRequestClass(playeridclassid) 
{ 
    SetupPlayerForClassSelection(playerid); 
    return 1; 
}

SetupPlayerForClassSelection(playerid)
{
    //?
}



Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 12:20


carl0987







Wiek: 37
Na forum: 4891 dni
Posty: 295
Nick w MP: Lolek

Piwa: 10

Respekt: 50

Ju? naprawi?em. Poprostu zmieni?em pozycje kamery :)

Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: braknie :: wybierałki..
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] Braknie Wybierałki.. 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