+- +-

+-Website Stats

Members
Total Members: 27
Latest: shahrukh
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 188
Total Topics: 56
Most Online Today: 0
Most Online Ever: 17
(October 07, 2012, 05:33:16 am)
Users Online
Members: 0
Guests: 0
Total: 0

Recent Posts

Pages: 1 [2] 3 4 ... 10
11
General / Re: {Urgent}Help Needed
« Last post by BlAck_DeViL on August 26, 2012, 09:56:57 pm »
One Warning is Coming
12
General / Re: {Urgent}Help Needed
« Last post by Lordz on August 26, 2012, 09:50:51 pm »
Code: [Select]
/*
* Maths FILTERSCRIPT
* This is a short minigame
* Answer maths task for money
*/


#include <a_samp>

// Colours
#define COLOR_GREEN 0x00CC00FF
#define COLOR_RED 0xFF0000FF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_ORANGE 0xEE9911FF
#define red    0xFF0000AA
#define blue    0x00FFFFAA
#define E_TIME 75 // Every how much seconds will new Maths game start
#define E_MAX_NUMBER 50 // Whats the highest number for script to choose as random
#define E_MIN_NUMBER 30 // Whats the smallest number for script to choose as random
#define E_CASH 10000 // How much will the player get for solving the task successfully

#if E_MAX_NUMBER < E_MIN_NUMBER
#error "MAX_NUMBER shouldn't be less than MIN_NUMBER"
#endif

enum E_SERVER_DATA
{
bool: E_STARTED,
E_ANSWER,
E_START_TIME,
E_TIMER,
}
new gServerData[E_SERVER_DATA];

forward LoadGame();

public OnFilterScriptInit()
{
print("Maths script is starting...");
print("Time between tests: " #E_TIME " seconds");
print("Min number: " #E_MIN_NUMBER " Max number: " #E_MAX_NUMBER );
SendClientMessageToAll(COLOR_YELLOW,"Maths script has been loaded!");

LoadGame();

SetTimer("LoadGame",E_TIME*1000,true);
return 1;
}

public OnFilterScriptExit()
{
print("Maths script has been unloaded!");
return 1;
}

public OnPlayerText(playerid, text[])
{
if(gServerData[E_STARTED] && strval(text) == gServerData[E_ANSWER]) {
GivePlayerMoney(playerid,E_CASH);
SetPlayerScore(GetPlayerScore(playerid)+1;

new msg[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(msg,sizeof(msg),"%s has solved a task successfully in %i seconds (Ans: %i)",name, GetTimerInSeconds(GetTickCount(),gServerData[E_START_TIME]), gServerData[E_ANSWER]);
SendClientMessageToAll(blue,msg);
print(msg);

gServerData[E_STARTED] = false;
gServerData[E_ANSWER] = 0;
gServerData[E_START_TIME] = 0;
return 1;
}
return 1;
}

public LoadGame()
{
new E_NUM1 = random(E_MAX_NUMBER-E_MIN_NUMBER) + E_MIN_NUMBER,
E_NUM2 = random(E_MAX_NUMBER-E_MIN_NUMBER) + E_MIN_NUMBER,
E_NUM3 = random(E_MAX_NUMBER-E_MIN_NUMBER) + E_MIN_NUMBER,
E_NUM4 = random(E_MAX_NUMBER-E_MIN_NUMBER) + E_MIN_NUMBER;

gServerData[E_STARTED] = true;
gServerData[E_ANSWER] = E_NUM1 + E_NUM2 - E_NUM3 + E_NUM4;
gServerData[E_START_TIME] = GetTickCount();

new msg[128];
format(msg,sizeof(msg),"First One who solve => %i + %i - %i + %i <= will get $%i and 1 score!",E_NUM1,E_NUM2,E_NUM3,E_NUM4,E_CASH);
SendClientMessageToAll(red,msg);
print(msg);
}

GetTimerInSeconds(now, started)
{
new secs, ms;
ms = now - started;
while(ms > 999) {
secs++;
ms = ms-1000;
}
return secs;
}
13
General / Re: {Urgent}Help Needed
« Last post by BlAck_DeViL on August 26, 2012, 09:43:16 pm »
Can u do it and give me now ?
14
General / Re: {Urgent}Help Needed
« Last post by Lordz on August 26, 2012, 09:41:56 pm »
Replace OnPlayerCommand text section from this script to this:
Code: [Select]
public OnPlayerText(playerid, text[])
{
if(gServerData[E_STARTED] && strval(text) == gServerData[E_ANSWER]) {
GivePlayerMoney(playerid,E_CASH);
SetPlayerScore(GetPlayerScore(playerid)+1);
15
General / {Urgent}Help Needed
« Last post by BlAck_DeViL on August 26, 2012, 09:34:57 pm »
Topic Removed
16
General / Re: A help
« Last post by BlAck_DeViL on August 24, 2012, 05:26:26 pm »
Cenation if u want i will help u in scipting....... :)
17
General / Re: A help
« Last post by Lordz on August 23, 2012, 08:48:54 pm »
Well thats what I asked that,what type of scripting do you need to get started?

You want to learn Mapping or Scripting?
Mapping
Mapping is too easy and can be done with MTA v1.1.1 easily.
Mapping does not require scripting but it needs to be converted to SAMP script.
And it can be converted through convertffs.com

Scripting
It is difficult and this contains many functions.
There aren't many alternate methods for this.



So,which do you want to get started?
18
General / Re: A help
« Last post by [RD]Cenation on August 23, 2012, 02:10:38 pm »
i mean like i am a newbie ok so i need to learn the basics of scriptings
19
General / Re: A help
« Last post by Lordz on August 22, 2012, 09:34:26 pm »
You mean you need to get started in scripting?
Example:Creating command,mapping,add created objects to script etc.?
Which do you want to get started with?
20
General / Re: A help
« Last post by [RD]Cenation on August 22, 2012, 08:41:34 am »
is the second part for setting up a server ? i mean the second link
and i know how to set up a server which i can only join
now i have it running and now to learn scripting
Pages: 1 [2] 3 4 ... 10

Recent Topics

MOVED: Creating TextDraw For Free ... :) by Lordz
August 30, 2012, 10:53:11 am

Website designer. by [RD]Cenation
August 29, 2012, 07:44:34 am

{Urgent}Help Needed by Lordz
August 27, 2012, 05:51:20 pm

A help by BlAck_DeViL
August 24, 2012, 05:26:26 pm

Hello all! by [RD]Cenation
August 21, 2012, 03:04:29 pm

Hello All by Lordz
August 20, 2012, 06:45:02 pm

Hello All by Lordz
August 18, 2012, 04:10:39 pm

Need PS2 game. by Lordz
August 18, 2012, 08:42:57 am

Map help.[Scripting] by YoUnG_Ca$h
August 16, 2012, 05:06:09 pm

I Want To Change My UserName , So i am Applying by BlAck_DeViL
August 16, 2012, 04:58:29 pm