05.12.2012, 01:30
Hello, I need help with one script. This is script for presents, and everithing is working but problem is that player must have some limit with opening gifts, he can opet gift once now and again in two hours, but there is problem, he can open gifts when ever he wants. So when he type /opengift he must get money. Here is script
Код:
#include <a_samp>
#include <streamer>
#define COLOR_GREEN 0x9EC73DAA
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
CreateDynamicObject(19058, -2010.34, 193.34, 27.19, 0.00, 0.00, 0.00);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/opengift", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, -2010.34, 193.34, 27.19))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(strcmp(name, "Matija_Isek",true)==0)
{
SendClientMessage(playerid, COLOR_GREEN,"You opened a gift.");
GivePlayerMoney(playerid, 10000);
SendClientMessage(playerid, COLOR_GREEN,"You got 10000$.");
return 1;
}
else
{
SendClientMessage(playerid,0xFF0000FF,"You aren't Matija_Isek!");
return 1;
}
}
else return SendClientMessage(playerid,0xFF0000FF,"ERROR: You're not close enough to the gift!");
}
return 1;
}
return 0;
}

