GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => A témát indította: Laurent - 2012. február 26. - 13:31:24

Cím: Sebesség mérõ
Írta: Laurent - 2012. február 26. - 13:31:24
Üdv , mai nap által elkészítettem a saját sebesség mérõmet
 

#include <a_samp>
new Float:svx[MAX_PLAYERS];
new Float:svy[MAX_PLAYERS];
new Float:svz[MAX_PLAYERS];
new Float:s1[MAX_PLAYERS];
new s2[MAX_PLAYERS];
new s3[MAX_PLAYERS][256];
new Text:sdisplay[MAX_PLAYERS];
new stimer[MAX_PLAYERS];
forward speedometer(playerid);
public OnGameModeInit()
{
sdisplay[playerid] = TextDrawCreate(477.0000,100.000,\" \");
TextDrawSetShadow(sdisplay[playerid],0);
TextDrawSetOutline(sdisplay[playerid],1);
TextDrawFont(sdisplay[playerid], 2);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate) {State ( ex States In_Vehicle, Dead, Passenger, Speculating... )
    KillTimer(stimer[playerid]);
    TextDrawSetString(sdisplay[playerid], \" \");
    if(newstate == 2) stimer[playerid] = SetTimerEx(\"speedometer\", 255, true, \"i\", playerid); 
    else if(newstate == 3) stimer[playerid] = SetTimerEx(\"speedometer\", 250, true, \"i\", playerid);
return 1;
}
public speedometer(playerid) {
    GetVehicleVelocity(GetPlayerVehicleID(playerid), svx[playerid], svy[playerid], svz[playerid]);
    s1[playerid] = floatsqroot(((svx[playerid]*svx[playerid])+(svy[playerid]*svy[playerid]))+(svz[playerid]*svz[playerid]))*100;
    s2[playerid] = floatround(s1[playerid],floatround_round);
    format(s3[playerid],256,\"~k~~r~%i ~b~~k~MPH\", s2[playerid]);
    TextDrawSetString(sdisplay[playerid], s3[playerid]);
    return 1;
}
Cím: Sebesség mérõ
Írta: norbee0170 - 2012. február 26. - 13:34:58
kep  v video nem artana
Cím: Sebesség mérõ
Írta: CANNONN - 2012. február 26. - 13:35:23
Kicsit kételkedek benne, hogy te csináltad, de ha igen akkor jó lett! ;)
 
kep  v video nem artana[/quote]
Cím: Sebesség mérõ
Írta: Fighter - 2012. február 26. - 13:35:38
Egy képet azért rakhatnál .
Cím: Sebesség mérõ
Írta: Laurent - 2012. február 26. - 13:36:11
mingyárt csinálok
Cím: Sebesség mérõ
Írta: norbee0170 - 2012. február 27. - 15:51:29
lehet h énvok hülye de hibás a script , sok az error
Cím: Sebesség mérõ
Írta: krissz96 - 2012. február 27. - 16:07:32
lehet h énvok hülye de hibás a script , sok az error[/quote]
nem te vagy a hülye :D
 
C:\\Documents and Settings\\Rendszergazda\\Asztal\\asd.pwn(14) : error 017: undefined symbol \"playerid\"
C:\\Documents and Settings\\Rendszergazda\\Asztal\\asd.pwn(15) : error 017: undefined symbol \"playerid\"
C:\\Documents and Settings\\Rendszergazda\\Asztal\\asd.pwn(16) : error 017: undefined symbol \"playerid\"
C:\\Documents and Settings\\Rendszergazda\\Asztal\\asd.pwn(17) : error 017: undefined symbol \"playerid\"
C:\\Documents and Settings\\Rendszergazda\\Asztal\\asd.pwn(20) : error 017: undefined symbol \"State\"
C:\\Documents and Settings\\Rendszergazda\\Asztal\\asd.pwn(20) : error 017: undefined symbol \"States\"
C:\\Documents and Settings\\Rendszergazda\\Asztal\\asd.pwn(20) : error 017: undefined symbol \"In_Vehicle\"
C:\\Documents and Settings\\Rendszergazda\\Asztal\\asd.pwn(20) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
8 Errors.

 

Dupla hozzászólás automatikusan összefûzve. ( 2012. február 27. - 16:20:52 )

amugy ez egy nagy sz*r script kijavitottam de nem müködött  :thumbsdown:
Cím: Sebesség mérõ
Írta: Laurent - 2012. február 27. - 18:34:31
nálam hibátlanul müködött
Cím: Sebesség mérõ
Írta: CANNONN - 2012. február 27. - 18:44:27
Remélem nem gond, hogy kijavítottam. Nem tudom, hogy mûködik-e, de szerintem igen. Hibát legalábbis nem jelez! ;)
 

#include <a_samp>
new Float:svx[MAX_PLAYERS], Float:svy[MAX_PLAYERS], Float:svz[MAX_PLAYERS], Float:s1[MAX_PLAYERS], s2[MAX_PLAYERS], s3[MAX_PLAYERS][256], Text:sdisplay[MAX_PLAYERS], stimer[MAX_PLAYERS];
forward speedometer(playerid);
public OnPlayerConnect(playerid)
{
sdisplay[playerid] = TextDrawCreate(477.0000,100.000,\" \");
TextDrawSetShadow(sdisplay[playerid],0);
TextDrawSetOutline(sdisplay[playerid],1);
TextDrawFont(sdisplay[playerid], 2);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    KillTimer(stimer[playerid]);
    TextDrawSetString(sdisplay[playerid], \" \");
    if(newstate == 2) stimer[playerid] = SetTimerEx(\"speedometer\", 255, true, \"i\", playerid);
    else if(newstate == 3) stimer[playerid] = SetTimerEx(\"speedometer\", 250, true, \"i\", playerid);
return 1;
}
public speedometer(playerid) {
    GetVehicleVelocity(GetPlayerVehicleID(playerid), svx[playerid], svy[playerid], svz[playerid]);
    s1[playerid] = floatsqroot(((svx[playerid]*svx[playerid])+(svy[playerid]*svy[playerid]))+(svz[playerid]*svz[playerid]))*100;
    s2[playerid] = floatround(s1[playerid],floatround_round);
    format(s3[playerid],256,\"~k~~r~%i ~b~~k~MPH\", s2[playerid]);
    TextDrawSetString(sdisplay[playerid], s3[playerid]);
    return 1;
}