Jump to content
Bekijk in de app

Een betere weg om onze GTA community te volgen. Leer meer.

GTAGames.nl - De Nederlandse Grand Theft Auto Community!

Een volledig scherm app op het beginscherm inclusief notificaties, badges en meer.

Om deze app op je iPhone en iPad te installeren
  1. Druk op het icoon in Safari
  2. Scroll in het menu en druk op Zet op beginscherm.
  3. Druk op Voeg toe rechts bovenaan.
Om deze app op je Android toe te voegen
  1. Druk op het 3-punten menu (⋮) rechts bovenaan in de browser.
  2. Druk op Toevoegen aan beginscherm of Installeer app.
  3. Druk op Toevoegen om te bevestigen.
Geplaatst:
comment_463592

Ik was weer eens aan het klooien in Pawno(X). En ik had een idee om een voertuig spawner te maken dat mensen een wagen konden spawnen via een commando. Maar dat was niet gelukt. Als iemand hier weet hoe te repareren... Tell me. Maar dit is nu meer bedoeld als voorbeeld filterscript.

#include <a_samp>

#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA

public OnFilterScriptInit()
{
 print("\n----------------------------------");
 print("Vehicle spawner\n");
 print("	   v0.1\n");
 print("	By: Ywa*NL\n");
 print("----------------------------------\n");
}

public OnPlayerCommandText(playerid, cmdtext[])
{
 new string[256];
 new cmd[256];
 new idx;

 cmd = strtok(cmdtext, idx);

 if(strcmp(cmd, "/spawnhelp", true) == 0)
 {
   SendPlayerFormattedText(playerid,"VEHICLE SPAWNER - VERSION 0.1 - BY: YWA*NL",0);
	  SendPlayerFormattedText(playerid,"Type: /spawn [ID] - spawn a vehicle with defined ID",0);
return 1;
 }
 if(strcmp(cmd, "/spawn", true) == 0)
 {
new tmp[256];
new id;
new Float:PosX;
new Float:PosY;
new Float:PosZ;
	  tmp = strtok(cmdtext, idx);
	  if(!strlen(tmp))
{
		   SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spawn [ID]");
	   	return 1;
	  }
		 id = strval(tmp);
	  if (id > 399 && id < 612)
{
  GetPlayerPos(playerid, PosX, PosY, PosZ);
//	  PosZ += 1.0;
		CreateVehicle(id, PosX, PosY, PosZ, 0.0, 0, 0, 1); // ???
		AddStaticVehicle(id, PosX, PosY, PosZ, 0.0, 0, 0); // ???
  //PutPlayerInVehicle(playerid, vehicleid, seatid);
		format(string, sizeof(string), "Spawned the defined vehicle (ID: %d).", id);
		SendClientMessage(playerid, COLOR_YELLOW, string);
		format(string, sizeof(string), "Debug %f | %f | %f", PosX, PosY, PosZ);
		SendClientMessage(playerid, COLOR_YELLOW, string);
	  }
	  else
	  {
		SendClientMessage(playerid, COLOR_WHITE, "Vehicle ID must be > 399 and < 612");
	  }
	  return 1;
 }
 return 0;
}

public OnPlayerConnect(playerid)
{
 SendPlayerFormattedText(playerid, "VEHICLE SPAWNER 0.1 ==> For help type /spawnhelp.", 0);
}

public SendPlayerFormattedText(playerid, const str[], define)
{
new tmpbuf[256];
format(tmpbuf, sizeof(tmpbuf), str, define);
SendClientMessage(playerid, 0xFFFF00AA, tmpbuf);
}

public SendAllFormattedText(playerid, const str[], define)
{
new tmpbuf[256];
format(tmpbuf, sizeof(tmpbuf), str, define);
SendClientMessageToAll(0xFFFF00AA, tmpbuf);
}

strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
	index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
	result[index - offset] = string[index];
	index++;
}
result[index - offset] = EOS;
return result;
}

Featured Replies

Geplaatst:
comment_463787

voertuigen spawnen met SA:MP kan simpelweg gewoon nog niet :)

Maar als ik de blogposts mag geloven zal je script bij de volgende versie wellicht werken:

Vehicles

I will also be overhauling the vehicle commands to allow dynamic creation, movement and destruction of vehicles through the script.

Een reactie plaatsen

Je kan nu een reactie plaatsen en pas achteraf registreren. Als je al lid bent, log eerst in om met je eigen account een reactie te plaatsen.

Gast
Op dit onderwerp reageren...

Recent actief 0

  • Er zijn hier geen geregistreerde gebruikers aanwezig.

Configureer push berichten

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.