Random Weapon [HELP] For Warning
#1

Sorry Topic Removed.......
Reply
#2

Which is line 60?
Reply
#3

Try this
pawn Code:
/*
* 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 + %d score points!",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;
}
Sorry for double post.
It happened in a hurry..
Reply
#4

Quote:

D:\GOD'ZV~1\FILTER~1\RANDOM~1.PWN(60) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

Then Also This Warning Is Coming
Reply
#5

Just give us the line 60.
Reply
#6

Quote:

SetPlayerScore(GetPlayerScore(playerid)+1);

This Is The Line 60
Reply
#7

Change it to:
pawn Code:
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
Reply
#8

thnz +Reped
Reply
#9

As far as it's solved, i'll give you a tip for further problems. When this warning shows up, search for that line with CTRL+G. Than, go ******, type "Samp" and than the function name that is showing warning, for example, in your case, "samp setplayerhealth", and open the link from samp wiki. Than, you will see the right format to use that function. See if there isn't any parameter missing in your function, and you'll probably solve it easily like this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)