08.02.2009, 12:54
i have problem when someone join to the server i see his stats it is the script that i do:
someone help please
sorry for bad English
Код:
#include <a_samp> #include <RLSB> // This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT forward UpdateTD(playerid); forward showstats(playerid); new Text:TextLevel; new Text:TextKills; new Text:TextBank; new stats[MAX_PLAYERS]; new bool:statsupdate[MAX_PLAYERS]; new string1[256]; new string2[256]; new string3[256]; #define COLOR_GREEN 0x33AA33AA #define COLOR_WHITE 0xFFFFFFAA public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Blank Filterscript by your name here"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); } public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("Blank Script"); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); return 1; } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); return 1; } public OnPlayerRequestSpawn(playerid) { return 1; } public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerPrivmsg(playerid, recieverid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/showstats", true) == 0) { if(stats[playerid] == 0) { statsupdate[playerid] = true; showstats(playerid); SendClientMessage(playerid, COLOR_WHITE, ".дфтмъ аъ дсиаи дъойгй"); TextDrawShowForPlayer(playerid,TextLevel); TextDrawShowForPlayer(playerid,TextKills); TextDrawShowForPlayer(playerid,TextBank); stats[playerid] = true; } else { statsupdate[playerid] = false; SendClientMessage(playerid, 0x083F6FF, ".бйимъ аъ дсиаи дъойгй"); TextDrawHideForPlayer(playerid,TextLevel); TextDrawHideForPlayer(playerid,TextKills); TextDrawHideForPlayer(playerid,TextBank); stats[playerid] = false; } return 1; } return 0; } public OnPlayerInfoChange(playerid) { return 1; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } public OnRconCommand(cmd[]) { return 1; } public OnObjectMoved(objectid) { return 1; } public OnPlayerObjectMoved(playerid, objectid) { return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } public OnPlayerSelectedMenuRow(playerid, row) { return 1; } public OnPlayerExitedMenu(playerid) { return 1; } public UpdateTD(playerid) { for(new i;i<MAX_PLAYERS;i++) { if(IsPlayerConnected(i)) { format(string1,sizeof(string1),"Level: %d",PlayerInfo[i][Level]); TextDrawSetString(TextLevel,string1); format(string2,sizeof(string2),"Kills: %d",PlayerInfo[i][Kills]); TextDrawSetString(TextKills,string2); format(string3,sizeof(string3),"Bank: %d",PlayerInfo[i][Bank]); TextDrawSetString(TextBank,string3); } } return 1; } public showstats(playerid) { TextLevel = TextDrawCreate(471.000000,349.000000,string1); TextDrawBackgroundColor(TextLevel,COLOR_GREEN); TextDrawLetterSize(TextLevel,0.699999,1.600000); TextDrawBackgroundColor(TextLevel,0x000000ff); TextDrawSetProportional(TextLevel,1); TextDrawColor(TextLevel,0xffffffff); TextDrawSetShadow(TextLevel,1); TextDrawFont(TextLevel,3); TextDrawAlignment(TextLevel,0); TextDrawSetOutline(TextLevel,1); TextKills = TextDrawCreate(471.000000,373.000000,string2); TextDrawBackgroundColor(TextKills,COLOR_GREEN); TextDrawLetterSize(TextKills,0.699999,1.600000); TextDrawBackgroundColor(TextKills,0x000000ff); TextDrawSetProportional(TextKills,1); TextDrawColor(TextKills,0xffffffff); TextDrawSetShadow(TextKills,1); TextDrawFont(TextKills,3); TextDrawAlignment(TextKills,0); TextDrawSetOutline(TextKills,1); TextBank = TextDrawCreate(471.000000,395.000000,string3); TextDrawBackgroundColor(TextBank,COLOR_GREEN); TextDrawAlignment(TextBank,0); TextDrawBackgroundColor(TextBank,0x000000ff); TextDrawFont(TextBank,3); TextDrawLetterSize(TextBank,0.699999,1.600000); TextDrawColor(TextBank,0xffffffff); TextDrawSetOutline(TextBank,1); TextDrawSetProportional(TextBank,1); TextDrawSetShadow(TextBank,1); TextDrawAlignment(TextKills,0); return 1; }
sorry for bad English