Jump to content
  • 0

erori FS


laury

Question

am luat un fs pt eventuri

scri /event si aparea un pct pe mapa unde esti in acel moment

uitati fs

#include <a_samp>
#include <core>
#include <float>

new glob0[500];


public OnPlayerConnect(playerid)
{
	glob0[playerid] = 0;
	return 0;
}

function3C(arg0, &arg1)
{
	new var0 = strlen(arg0);
	while(arg1 < var0 && arg0[arg1] <= 32)
	{
		arg1++;
	}
	new var1 = arg1;
	new var2[20];
	while(arg1 < var0 && arg0[arg1] > 32 && arg1 - var1 < 19)
	{
		var2[arg1 - var1] = arg0[arg1];
		arg1++;
	}
	var2[arg1 - var1] = 0;
	return var2;
}

public OnPlayerCommandText(playerid, cmdtext)
{
	new var0[256];
	new var1[24];
	new var2[256];
	new var3 = 0;
	var2 = function3C(cmdtext, var3);
	if(!strcmp(var2, "/event", true))
	{
		if(glob0[playerid] == 1)
		{
			GetPlayerName(playerid, var1, 24);
			format(var0, 256, "[Event Info] %s [ID:%d] Eventul sa terminat !", var1, playerid);
			SendClientMessageToAll(0xFF0000FF, var0);
			glob0[playerid] = 0;
			SetPlayerHealth(playerid, 100.0);
			SetPlayerArmour(playerid, 0.0);
			SetPlayerColor(playerid, 0xFF0000FF);
		}
		else
		{
			GetPlayerName(playerid, var1, 24);
			format(var0, 256, "[Event Info] %s [ID:%d] Face event la punctul Rosu. ", var1, playerid);
			SendClientMessageToAll(0xFF0000FF, var0);
			glob0[playerid] = 1;
			SetPlayerHealth(playerid, 100.0);
			SetPlayerArmour(playerid, 50.0);
			SetPlayerColor(playerid, 0xFF0000FF);
			for(new var4 = 0; var4 < 500; var4++)
			{
				if(IsPlayerConnected(var4))
				{
					SetPlayerMarkerForPlayer(var4, playerid, 0xFF0000FF);
				}
			}
		}
		return 1;
	}
	return 0;
}

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

stuntman-=!!" post="44130" timestamp="1288346484"]

nu poti sa le rezolvi decat foarte greu...

nu e mare branza :) se rezolva imediat :)

acum eu am rezolvat erorile ... nush daca merge comanda :) nu am sters nik decat am pus strtok in loc de function3C si o modificare la OnPlayerCommandText.... trebuia pus cmdtext[] ... el avea doar cmdtext :)

#include <a_samp>
#include <core>
#include <float>

new glob0[500];

#define MAX_STRING 255

public OnPlayerConnect(playerid)
{
   glob0[playerid] = 0;
   return 0;
}

strtok(const string[], &index,seperator=' ')
{
	new length = strlen(string);
	new offset = index;
	new result[MAX_STRING];
	while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}

	result[index - offset] = EOS;
	if ((index < length) && (string[index] == seperator))
	{
		index++;
	}
	return result;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
   new var0[256];
   new var1[24];
   new var2[256];
   new var3 = 0;
   var2 = strtok(cmdtext, var3);
   if(!strcmp(var2, "/event", true))
   {
      if(glob0[playerid] == 1)
      {
         GetPlayerName(playerid, var1, 24);
         format(var0, 256, "[Event Info] %s [ID:%d] Eventul sa terminat !", var1, playerid);
         SendClientMessageToAll(0xFF0000FF, var0);
         glob0[playerid] = 0;
         SetPlayerHealth(playerid, 100.0);
         SetPlayerArmour(playerid, 0.0);
         SetPlayerColor(playerid, 0xFF0000FF);
      }
      else
      {
         GetPlayerName(playerid, var1, 24);
         format(var0, 256, "[Event Info] %s [ID:%d] Face event la punctul Rosu. ", var1, playerid);
         SendClientMessageToAll(0xFF0000FF, var0);
         glob0[playerid] = 1;
         SetPlayerHealth(playerid, 100.0);
         SetPlayerArmour(playerid, 50.0);
         SetPlayerColor(playerid, 0xFF0000FF);
         for(new var4 = 0; var4 < 500; var4++)
         {
            if(IsPlayerConnected(var4))
            {
               SetPlayerMarkerForPlayer(var4, playerid, 0xFF0000FF);
            }
         }
      }
      return 1;
   }
   return 0;
}

tLYRl.gif
Link to comment
Share on other sites

RuNix" post="44143" timestamp="1288349601"]

nu e mare branza :) se rezolva imediat :)

acum eu am rezolvat erorile ... nush daca merge comanda :) nu am sters nik decat am pus strtok in loc de function3C si o modificare la OnPlayerCommandText.... trebuia pus cmdtext[] ... el avea doar cmdtext :)

#include <a_samp>
#include <core>
#include <float>

new glob0[500];

#define MAX_STRING 255

public OnPlayerConnect(playerid)
{
   glob0[playerid] = 0;
   return 0;
}

strtok(const string[], &index,seperator=' ')
{
	new length = strlen(string);
	new offset = index;
	new result[MAX_STRING];
	while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}

	result[index - offset] = EOS;
	if ((index < length) && (string[index] == seperator))
	{
		index++;
	}
	return result;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
   new var0[256];
   new var1[24];
   new var2[256];
   new var3 = 0;
   var2 = strtok(cmdtext, var3);
   if(!strcmp(var2, "/event", true))
   {
      if(glob0[playerid] == 1)
      {
         GetPlayerName(playerid, var1, 24);
         format(var0, 256, "[Event Info] %s [ID:%d] Eventul sa terminat !", var1, playerid);
         SendClientMessageToAll(0xFF0000FF, var0);
         glob0[playerid] = 0;
         SetPlayerHealth(playerid, 100.0);
         SetPlayerArmour(playerid, 0.0);
         SetPlayerColor(playerid, 0xFF0000FF);
      }
      else
      {
         GetPlayerName(playerid, var1, 24);
         format(var0, 256, "[Event Info] %s [ID:%d] Face event la punctul Rosu. ", var1, playerid);
         SendClientMessageToAll(0xFF0000FF, var0);
         glob0[playerid] = 1;
         SetPlayerHealth(playerid, 100.0);
         SetPlayerArmour(playerid, 50.0);
         SetPlayerColor(playerid, 0xFF0000FF);
         for(new var4 = 0; var4 < 500; var4++)
         {
            if(IsPlayerConnected(var4))
            {
               SetPlayerMarkerForPlayer(var4, playerid, 0xFF0000FF);
            }
         }
      }
      return 1;
   }
   return 0;
}

ms moolt a mers compile acu o sa incerc comanda

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.