14.08.2012, 21:34
Hello,
I made a paycheck system which included two timers,one for showing it and the second to hide that,but I really messes up when I put that in the server so can anyone help me do it with one timer?Please.
Here are the codes:
I made a paycheck system which included two timers,one for showing it and the second to hide that,but I really messes up when I put that in the server so can anyone help me do it with one timer?Please.
Here are the codes:
PHP код:
#include <a_samp>
#if defined FILTERSCRIPT
#include <sscanf2>
#include <YSI\y_commands>
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
new Text:Textdraw0;
new Text:Textdraw1;
forward paycheck(playerid);
forward paycheckshow(playerid);
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
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);
Textdraw0 = TextDrawCreate(493.000000, 302.000000, "PayCheck");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 3);
TextDrawLetterSize(Textdraw0, 0.829999, 3.799999);
TextDrawColor(Textdraw0, 16711935);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 4);
Textdraw1 = TextDrawCreate(575.000000, 337.000000, "$500");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 1);
TextDrawLetterSize(Textdraw1, 0.500000, 3.299998);
TextDrawColor(Textdraw1, 16711935);
TextDrawSetOutline(Textdraw1, 0);
TextDrawSetProportional(Textdraw1, 1);
TextDrawSetShadow(Textdraw1, 4);
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 OnPlayerSpawn(playerid)
{
SetTimerEx("paycheck",3600000,true,"i",playerid);
SetTimerEx("paycheckshow",3555599,true,"i",playerid);
return 1;
}
YCMD:setlevel(playerid, params[])
{
if(gPlayerLoggedIn[playerid] == 0) return 1;
if(IsPlayerAdmin(playerid) {
new skin, player;
if(sscanf(params, "ud", player, skin)) return SendClientMessage(playerid, COLOR_GREY, "[USAGE]: /setlevel [Part of Name/ID] [level]");
if(!IsPlayerConnected(player)) return SendClientMessage(playerid, COLOR_GREY, "Player is not connected.");
SetPlayerScore(player, score);
new string[126];
format(string, sizeof(string), "AdmWarning: %s set %s's level to %d.", PlayerName(playerid), PlayerName(player), level);
AMessage(COLOR_LIGHTRED, string);
return 1;
}
return 1;
}
public paycheckshow(playerid)
{
TextDrawHideForPlayer(playerid,Text:Textdraw0);
TextDrawHideForPlayer(playerid,Text:Textdraw1);
}
public paycheck(playerid)
{
TextDrawShowForPlayer(playerid,Text:Textdraw0);
TextDrawShowForPlayer(playerid,Text:Textdraw1);
GivePlayerMoney(playerid,500);
for(new i=0; i != MAX_PLAYERS; i++)
{
new score;
score = GetPlayerScore(i);
SetPlayerScore(i, score+1);
}
}