15.10.2011, 18:16
rewritten (this doesnt fix the crash only the scripting related mistakes)
and if you wanna know why gta crashes check the first gray box on that page
pawn Код:
public HelpdeskUp(playerid) {
new hdesk[500];
if(GetPlayerName(playerid, hdesk[100], MAX_PLAYER_NAME)) { // checks if the player is connected
new hour, minute, second, day, month, year;
gettime(hour, minute, second);
getdate(year, month, day);
switch(pInfo[playerid][admin) {
case 0: hdesk = "Normal";
case 1: hdesk = "Supporter";
case 2: hdesk = "Moderator";
case 3: hdesk = "Suprt Moderator";
case 4: hdesk = "Administrator";
case 5: hdesk = "Serverletiung";
}
format(hdesk, sizeof hdesk, "\
~w~ .::Hilfeleiste::.~n~~n~\
Rang:~r~ %s~n~\
~w~Uhrzeit:~g~ %d:%d %d~n~\
~w~Datum:~g~ %d.%d.%d~n~\
~w~Dein Nickname:~g~ %s~n~\
~w~Dein ID: %d~n~\
Kontostand:~y~ %d$~n~\
~w~Hunger/Durst:~g~ %d~n~\
~w~Energie:~g~ %d~n~\
~w~Harndrang:~g~ %d",
hdesk, hour, minute, second, day, month, year, hdesk[100], playerid, pInfo[playerid][pBank], pInfo[playerid][hunger], pInfo[playerid][energie], pInfo[playerid][harndrang]);
for(new haus = 1; haus != MAX_HAUS; ++haus) {
if(IsPlayerInRangeOfPoint(playerid, 5.0, HausInfo[haus][haus_x], HausInfo[haus][haus_y], HausInfo[haus][haus_z])) {
format(hdesk, sizeof hdesk, "%s~n~~n~\
~w~ .::Hausinfo::..~n~~n~\
~w~Besitzer: %s~n~\
Preis: %d$~n~\
Miete: %d$~n~\
Mieter 1: %s~n~\
Mieter 2: %s~n~\
Mieter 3: %s~n~\
Mieter 4: %s~n~\
Mieter 5: %s",
hdesk, HausInfo[haus][haus_besitzer], HausInfo[haus][haus_preis], HausInfo[haus][Mieter1], HausInfo[haus][Mieter2], HausInfo[haus][Mieter3], HausInfo[haus][Mieter4], HausInfo[haus][Mieter5]);
break;
}
}
TextDrawSetString(Helpdesk, hdesk);
SetWorldTime(hour);
return 1;
}
return 0;
}