Jump to content
  • 0

Problema legata de un FS


Guest Mariachi

Question

11 answers to this question

Recommended Posts

  • 0

Pai Seif_  nu a mai pus inceputul scriptului ca venea de la sine.Daca te-ai fi uitat intr-un script ai vedea la inceput ca scrie #include <a_samp> .Tu poate nu l-ai pus.Pune-l si daca nu merge cauta altu.

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

Link to comment
Share on other sites

  • 0

//OnPlayerCommandText(playerid, cmdtext[])
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
//alte comenzi
if (strcmp(cmd, "/savep", true) == 0)
{
 	new str[256];
	new comment[256];
	new Float:Angle;
	tmp = strtok(cmdtext,idx);
	if(!strlen(tmp))
	{
		SendClientMessage(playerid,0xF97804FF,"USAGE: /savep [class/vehicle/object/pickup/position] [comment]");
		SendClientMessage(playerid,0xF97804FF,"FUNCTION: Will save your position and create a file to save it in.");
		SendClientMessage(playerid,0xF97804FF,"HELP: Class: AddPlayerClass - Vehicle: CreateVehicle - Object: CreateObject");
		SendClientMessage(playerid,0xF97804FF,"HELP: Pickup: CreatePickup - Position: X,Y,Z,Angle");
		SendClientMessage(playerid,0xF97804FF,"HELP: You don't have to enter a comment.");
	}
	else if(strcmp(tmp,"class",true) == 0)
	{
	    new length = strlen(cmdtext);
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		while ((idx < length) && ((idx - offset) < (sizeof(comment) - 1)))
		{
			comment[idx - offset] = cmdtext[idx];
			idx++;
		}
		comment[idx - offset] = EOS;
	    GetPlayerPos(playerid,X,Y,Z);
	    GetPlayerFacingAngle(playerid,Angle);
		new skin = GetPlayerSkin(playerid);
		format(string,sizeof(string),"AddPlayerClass(%d,%.0f,%.0f,%.0f,%.0f,0,0,0,0,0,0); // %s",skin,X,Y,Z,Angle,comment);
		new File: save = fopen("savedcoords.txt",io_append);
		format(str,256," \r\n");
		fwrite(save, string);
		fwrite(save,str);
		fclose(save);
		SendClientMessage(playerid,0x38FF06FF,string);
	}
	else if(strcmp(tmp,"vehicle",true) == 0)
	{
	    new length = strlen(cmdtext);
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		while ((idx < length) && ((idx - offset) < (sizeof(comment) - 1)))
		{
			comment[idx - offset] = cmdtext[idx];
			idx++;
		}
		comment[idx - offset] = EOS;
	    GetPlayerPos(playerid,X,Y,Z);
	    GetPlayerFacingAngle(playerid,Angle);
		new model = GetVehicleModel(GetPlayerVehicleID(playerid));
		format(string,sizeof(string),"CreateVehicle(%d,%.0f,%.0f,%.0f,%.0f,-1,-1,180000); // %s",model,X,Y,Z,Angle,comment);
		new File: save = fopen("savedcoords.txt",io_append);
		format(str,256," \r\n");
		fwrite(save, string);
		fwrite(save,str);
		fclose(save);
		SendClientMessage(playerid,0x38FF06FF,string);
	}
	else if(strcmp(tmp,"object",true) == 0)
	{
	    new objectid[256];
		objectid = strtok(cmdtext,idx);
	    if(!strlen(objectid))
		{
			SendClientMessage(playerid,0xF97804FF,"USAGE: /savep object [objectid] [comment]");
			SendClientMessage(playerid,0xE60000FF,"ERROR: You have to enter an object id to continue! If you don't know the ID, type anything to proceed");
			return 1;
		}
	    new length = strlen(cmdtext);
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		while ((idx < length) && ((idx - offset) < (sizeof(comment) - 1)))
		{
			comment[idx - offset] = cmdtext[idx];
			idx++;
		}
		comment[idx - offset] = EOS;
	    GetPlayerPos(playerid,X,Y,Z);
		format(string,sizeof(string),"CreateObject(%s,%.0f,%.0f,%.0f,0,0,0); // %s",objectid,X,Y,Z,comment);
		new File: save = fopen("savedcoords.txt",io_append);
		format(str,256," \r\n");
		fwrite(save, string);
		fwrite(save,str);
		fclose(save);
		SendClientMessage(playerid,0x38FF06FF,string);
	}
	else if(strcmp(tmp,"pickup",true) == 0)
	{
	    new pickupid[256];
		pickupid = strtok(cmdtext,idx);
	    if(!strlen(pickupid))
		{
			SendClientMessage(playerid,0xF97804FF,"USAGE: /savep pickup [pickupid] [comment]");
			SendClientMessage(playerid,0xE60000FF,"ERROR: You have to enter a pickup id to continue! If you don't know the ID, type anything to proceed");
			return 1;
		}
	    new length = strlen(cmdtext);
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		while ((idx < length) && ((idx - offset) < (sizeof(comment) - 1)))
		{
			comment[idx - offset] = cmdtext[idx];
			idx++;
		}
		comment[idx - offset] = EOS;
	    GetPlayerPos(playerid,X,Y,Z);
		format(string,sizeof(string),"CreatePickup(%s,23,%.0f,%.0f,%.0f); // %s",pickupid,X,Y,Z,comment);
		new File: save = fopen("savedcoords.txt",io_append);
		format(str,256," \r\n");
		fwrite(save, string);
		fwrite(save,str);
		fclose(save);
		SendClientMessage(playerid,0x38FF06FF,string);
	}
    else if(strcmp(tmp,"position",true) == 0)
	{
	    new length = strlen(cmdtext);
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		while ((idx < length) && ((idx - offset) < (sizeof(comment) - 1)))
		{
			comment[idx - offset] = cmdtext[idx];
			idx++;
		}
		comment[idx - offset] = EOS;
	    GetPlayerPos(playerid,X,Y,Z);
	    GetPlayerFacingAngle(playerid,Angle);
		format(string,sizeof(string),"// %f, %f, %f,%.0f // %s",X,Y,Z,Angle,comment);
		new File: save = fopen("savedcoords.txt",io_append);
		format(str,256," \r\n");
		fwrite(save, string);
		fwrite(save,str);
		fclose(save);
		SendClientMessage(playerid,0x38FF06FF,string);
	}
	else
	{
		SendClientMessage(playerid,0xF97804FF,"USAGE: /savep [class/vehicle/object/pickup/position] [comment]");
	}
	return 1;
}
//alte comenzi

Poate nu ai pus bine codul in script.

Link to comment
Share on other sites

  • 0

Are comanda /save dar nu copii tot de akolo ci doar pana la 0,0,0,0, si inainte pana incepe cu - s-au direct din 4 cifre.

Eu nu inteleg nimic.

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Similar Content

    • By Monkey2K
      Salut, cand folosesc comanda /save imi apare eroare aceasta "i can't open the savepositions.txt file for append". Cum o pot rezolva?
      Edit: Am fisierul savepositions in GTA San Andreas User Files dar nu salveaza.
    • By St3f4n36
      Cum as putea fac urmatoarea chestie:
      Daca intr-un dialog imi apare ca primeste x bani daca apasa cazul 1 ( banii formati cu new money = 100 + rand(100); )
      si dupa sa imi trimita un mesaj tot cu aceasi suma de bani x. Trebuie salvata intr-o variabila sau cum?
    • By ZeNY
      Salut SA-MP Romania,
      Am venit aici cu o problema des intalnita dar insa nu i am dat de cap
      **Eroarea / Warningul **
      [22:13:05] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
      [22:13:06] [ERROR] cache_get_field_content_int - invalid datatype
       
      Stiu ca eroarea a mai fost intalnita dar nimeni nu a rezolvat-o
      **Cod/Script** : 
      1.                     cache_get_field_content_int(0, "AddBy");
      2.    CarInfo[id][cModel] = cache_get_field_content_int(0, "Model");
      3.         DSModels[i][dID]                 = cache_get_field_content_int(0, "ID");
      4.     if(cache_num_rows() > 0) cache_get_field_content_int(0, "Warns", intid);
      5.        cache_get_field_content_int(0, "Tax", Tax);
      6.         BizzInfo[v][bID]                       =     cache_get_field_content_int(0, "ID");                
      Va rog, poate se poate rezolva
      Versiunea MYSQL R39
      Si gamemode-ul a avut R34
    • By FlobertRO
      Buna , am si eu o problema . Mi-se restarteaza serverulul random . In server_log am gasit asta : 
      Stie cineva ce pot face  Va rog ❤️ . Multumesc frumos
       
       
      [23:17:26] [join] rezana has joined the server (1:---------------------) [23:17:26] [debug] Run time error 4: "Array index out of bounds" [23:17:26] [debug] Accessing element at index 1 past array upper bound 0 [23:17:26] [debug] AMX backtrace: [23:17:26] [debug] #0 00200b24 in ?? (... <1 argument>) at GM.pwn:8108 [23:17:26] [debug] #1 000aef80 in public MP_OPC (playerid=1) at C:\Users\xda\Desktop\gamemode-impact\gamemode-rpg-impact\pawno\include\YSI\y_hooks/impl.inc:633 [23:17:26] [debug] #2 native CallLocalFunction () from samp03svr [23:17:26] [debug] #3 0000c77c in public SSCANF_OnPlayerConnect (playerid=1) at C:\Users\xda\Desktop\gamemode-impact\gamemode-rpg-impact\pawno\include\mSelection.inc:432 [23:17:26] [debug] #4 00003210 in public Itter_OnPlayerConnect (playerid=1) at C:\Users\xda\Desktop\gamemode-impact\gamemode-rpg-impact\pawno\include\sscanf2.inc:236 [23:17:26] [debug] #5 00001684 in public OnPlayerConnect (playerid=1) at C:\Users\Florin\Dxda\gamemode-impact\gamemode-rpg-impact\pawno\include\YSI\y_iterate.inc:646
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.