Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - stormeus

Pages: 1 ... 58 59 [60] 61 62 63
886
mIRC/pawn Scripting / Re: Register/Login .....
« on: April 30, 2011, 08:16:15 pm »
Please Create Register/Login System... On (pawno)  :-\

GUPS has a working registration/login system that you can use. You can look at its source and extract it from there.
http://forum.vicecitymultiplayer.com/index.php?topic=1666.0

887
Support / Re: Problem running VC-MP
« on: April 30, 2011, 08:13:25 pm »

888
mIRC/pawn Scripting / Re: i got Stucked
« on: April 28, 2011, 11:29:25 pm »
Thanks Stormeus 

File:fileoo

and wat about other two

Post the code for new plrteam

889
mIRC/pawn Scripting / Re: i got Stucked
« on: April 28, 2011, 10:39:24 pm »
Quote
*:***\******\*****\****HLDS.pwn(692) : warning 213: tag mismatch
*:***\******\*****\****HLDS.pwn(693) : warning 213: tag mismatch
*:***\******\*****\****HLDS.pwn(695) : warning 213: tag mismatch
*:***\******\*****\****HLDS.pwn(866) : warning 213: tag mismatch
*:***\******\*****\****HLDS.pwn(904) : warning 213: tag mismatch

Pawn compiler 3.0.3367         Copyright (c) 1997-2005, ITB CompuPhase


5 Warnings.

quote that Gives this Is:
Lines (692 , 693 , 695)
for 3 warnings:
Quote
else if (strcmp(cmd, "maplist", true) == 0) {
         
      new conty[1024];
      new filepathz[256];
         format(filepathz,sizeof(filepathz),"/MiniWar/Mapslist.ini");
    if(fexist(filepathz)) {
      new fileoo;
692      fileoo = fopen(filepathz,io_read);
693      fread(fileoo,conty,1204);
            SendClientMessage(playerid,COLOR_YELLOW,conty);
695      fclose(fileoo);
   }
      return 1;
      }
other Line (866)
Quote
866   else if(plrteam[playerid][Terrorist] == 0) {SendClientMessage(playerid,COLOR_YELLOW,"Only Terrorist Can Plant BOMB");}

Line (904)

Quote
904   else if(plrteam[playerid][Terrorist] == 0) {SendClientMessage(playerid,COLOR_YELLOW,"Only Terrorist Can Plant BOMB");}


I got Really Stucked at these Warnings Please Fix them

new fileoo;

To use fopen, you have to specifically say the variable's a file. Use new File:fileoo;

890
floor or float

fix it Babe



          MessagePlayer( "The server has been online for" + floor( GetTickCount() / 60000 ) + " minutes.", player );


New hosting !


Actually, floor() is a valid function in Squirrel. It means to round down to the nearest whole number. Anyways, good job, Castagna!

893
mIRC/pawn Scripting / Re: How!!!
« on: April 25, 2011, 07:18:43 pm »
not works
not work to lock server in pawn ... i think...

at me not work
password    Any string    None    Sets a server password. NOTE, your server will APPEAR unlocked with the Windows server, leaving no obvious way for anyone to get in.

894
Support / Re: How to kick
« on: April 25, 2011, 07:15:57 pm »
Troll noob

Use Common Sense .. In Script .pwn

BIG, try to actually help newbies to scripting. Don't call them trolling noobs or they won't learn.

895
Support / Re: How to kick
« on: April 25, 2011, 03:00:09 pm »
i want to kick with reason what   i have to add

You don't have to add anything to kick with reasons.

896
Support / Re: How to kick
« on: April 25, 2011, 02:25:42 pm »
hey i need to kick  players with reason is it without Reasonable....

If you get rid of this line:
else if (!strlen(reason)) SendClientMessage(playerid,0xFFFF00AA,"USAGE: /c kick [Nick/ID] [Reason]");

You won't need a reason to kick.

897
Support / Re: How to kick
« on: April 25, 2011, 01:38:23 pm »
[IMG=http://img233.imageshack.us/img233/9922/25305695.png][/IMG]

Uploaded with ImageShack.us

First thing: what happened to FindPlayerIDFromString()? It looks like you completely erased it. Replace this code:
public FindPlayerIDFromString(string)
{}


With this code:
Code: [Select]
public FindPlayerIDFromString(string[])
{// for determining player id from a string  -bakasan
new player = INACTIVE_PLAYER_ID;
new p = 0;
while (p < MAX_PLAYERS)
{
if (strfind(gPlayers[p],string,true) != -1)
{
player = p;
break;
}
p++;
}
if (player == INACTIVE_PLAYER_ID) {// string didnt match so check if it can be an id
if ((strlen(string) > 2) || (isnumeric(string) == 0)) { return INACTIVE_PLAYER_ID; }
player = strval(string);// string is numeric and not more than 2 digits
}
if (!IsPlayerConnected(player)) { return INACTIVE_PLAYER_ID; }
return player;// valid id found
}

Another problem is that your code isn't in the right place. Everything between if (strcmp and Kick(plr); } should be somewhere in OnPlayerCommandText.

898
mIRC/pawn Scripting / Re: !givecash fails
« on: April 25, 2011, 01:33:08 pm »
That work now, but when i type id/nick someone's it sends cash to me no matter what.

In the beginning of your code, tmp is used for the nick/ID, and tmp2 is used for the amount. Then this gets switched in your format statement, and it says it sent $[player id] to you because you use playerid instead of plr.

format(szMsg,sizeof(szMsg),"You have sent:[ $%d ] to: [ %s ]",tmp,gPlayers[playerid]);

Replace tmp with tmp2
Replace gPlayers[playerid] with gPlayers[plr]

By the way, instead of using StrToInt, you can use the native strval() function instead.

Other than that, I can't see much else wrong with your code.

899
mIRC/pawn Scripting / Re: !givecash fails
« on: April 25, 2011, 10:56:03 am »
Quote
      else if (strcmp(cmd, "!givecash", true) == 0) {
          new tmp2[256], plr;
      tmp = strtok(cmdtext, idx), tmp2 = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if (!strlen(tmp2)) SendClientMessage(playerid,COLOR_GREEN, "USAGE: !givecash [Nick/ID] [Amount]");
      else if (GetPlayerHandCash(gPlayers[playerid]) < StrToInt(tmp2)) SendClientMessage(playerid,COLOR_GREEN, "Error: You havent got the needed money.");
      else if (plr != INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
      else if(!IsPlayerRegistered(gPlayers[plr])) SendClientMessage(playerid, COLOR_RED, "Error: That nick is not registered!");
      else if (!IsNumeric(tmp2)) SendClientMessage(playerid,COLOR_GREEN, "Error: Invalid Amount!");
      else {
         format(szMsg,sizeof(szMsg),"You have sent:[ $%d ] to:[ %s ]",tmp,gPlayers[playerid]);
         SendClientMessage(playerid,COLOR_GREEN, szMsg);
         DecPlayerHandCash(playerid,StrToInt(tmp));
         IncPlayerHandCash(plr,StrToInt(tmp));
      }
      return 1;
      }

When I want send some one money it's say all time "invalid id" I type nick "invalid id". HELP!!!


else if (plr != INACTIVE_PLAYER_ID)

The != tells Pawn that if the ID is NOT an invalid player, that it should stop and tell them they don't have the required money.

Replace != with == so that it checks if the ID IS an invalid player.

900
Tutorials / The Absolute Beginner's Guide to Pawn, Part III
« on: April 25, 2011, 02:09:41 am »
Part III
Arrays and Strings

Introduction
Arrays are like variables, except that they allow you to store more than one value in a given variable while only using one reference. Imagine a variable as a box that can hold a certain type. An array would be the equivalent of that same box divided into multiple pieces, each piece containing a piece of data. Of course, since the array box stores more information than the single variable box, it is bigger, so it uses more memory.

Array Indexes
We can use the same name to get the value of a part in the array, but we need a way to differentiate between each cell, or part, of the array. To do this, we use a zero-index in the array. Let's say we have an array that's 100 cells large. The zero-index, as you might assume, starts at zero, so our first value is myArray[0], and the 100th value is myArray[99]. The fifth value is myArray[4], so think of it as myArray[item number - 1].

Creating Arrays
Arrays are declared similarly to regular variables, except we specify how many array cells we want to use. Unlike the zero-index, when you create the array, you specify exactly how many cells you want to use, i.e. new myArray[10] for an array named myArray 10 cells long.

Using Array Cells
Once you have declared an array, you can use an array index to both store and get information stored in that cell. Right now, we can only store integers and floats in our arrays. Strings and characters will come later. Let's say we want to, like our last example, set the payrolls of each department into an array, with payrollArray[0] reserved for department 1, payrollArray[1] for department 2, etc. First, instantiate (create) a new array with new payrollArray[5];

Given that we know each department's payroll is $10,000 times the department ID, we can use our mathematical operators, a for loop, and our array. We've declared our array, so now let's create our for loop to iterate through each department, starting at 1 and ending at 5.

Code: [Select]
// Declare our new array
new payrollArray[5];

// Iterate through each department.
for(new i = 1; i < 5; i++)
{
// <code here>
}

However, this still doesn't store each department's payroll in the array. Trying to compile this will result in an array something like payrollArray is unused. Since our array starts at index 0 while our department IDs start at 1, we can subtract 1 from the department ID to get the array index that goes with it. Array indexes, as long as they're integral, are valid, so mathematical expressions can also be array indexes, like so: payrollArray[i - 1]; with i - 1 being the array index (DepartmentID - 1). If i was 1, the index would be 0, which is valid, so let's use this to our advantage.

We also know that our payroll is $10,000 times the department ID, so whatever the cell is, it will be equal to the department ID * 10000 (note that there are NO commas in numbers).

Code: [Select]
// Declare our new array.
new payrollArray[5];

// Iterate through each department.
for(new i = 1; i < 5; i++)
{
// i - 1 = DepartmentID - 1, for our zero-indexed array
payrollArray[i - 1] = i * 10000; // Department ID * 10000
}

We can now get the payroll from this array by using payrollArray[ID - 1]

Strings
A string is simply an array of characters (letters and punctuation) which, when put together, form a sentence, phrase, word, etc. Since they are arrays, they work similar to integral arrays, except each cell is one letter or punctuation mark. In addition, the last character in the string has to be a null character (\0), which tells the computer when the string ends. Strings can be as long or longer than the sentence that they hold. For example, the following sentence is 12 characters long:

I like pie.

It consists of 11 letters and punctuation marks, plus the null character at the end. myString[12] would work for it. myString[25] would work too. However, myString[11] is invalid. Each cell is going to be one letter, thus:

myString[0] = "I"
myString[1] = " "
myString[4] = "k"

Strings can also be formatted using the format() function, which will be described in further detail later. Entire strings can be created at once as well. If we want to use our "I like pie." sentence for our string, we first have to declare our new array.

new myString[12];

Instead of saving to individual cells, we can instead reference just the variable, then place the sentence inside a string, enclosed by double quotes (""). For example:

myString = "I like pie."

This will automatically include the null character at the end.

Pages: 1 ... 58 59 [60] 61 62 63