Skip to content
View in the app

A better way to browse. Learn more.

GTAGames.nl - De Nederlandse Grand Theft Auto Community!

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

giveweapon command

Hallo,

Ik heb een probleem gevonden met het GiveWeapon command van mijn script, mijn Givemoney script werkt wel, vreemdgenoeg.

Ik kan de fout er niet in vinden...

Hier is het stukje script:

// === [Giveweapon] ===
if(strcmp(cmd,"/giveweapon",true) == 0)
{
	GetPlayerName(playerid, sendername, sizeof(sendername));
	PlayerInfo[playerid][pAdmin] = dini_Int(file, "AdminLevel");
	new weaponid;
	new giveammo;
	tmp = strtok(cmdtext, idx);
	if(gLogged[playerid] == 0)
	{
		SendClientMessage(playerid, COLOR_GREY, "SERVER: You must be logged in to use this command!");
	}
	if(!strlen(tmp))
	{
		SendClientMessage(playerid, COLOR_DBLUE,"Correct Usage: /giveweapon [id] [weaponid] [ammo]");
		return 1;
	}
	if(IsStringAName(tmp))
	{
		giveplayerid = GetPlayerID(tmp);
	}
	else
	{
		giveplayerid = strval(tmp);
	}
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp))
	{
		SendClientMessage(playerid, COLOR_DBLUE,"Correct Usage: /giveweapon [id] [weaponid] [ammo]");
		return 1;
	}
	weaponid = strval(tmp);
	if(weaponid < 0 || weaponid > 46)
	{
		SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid weapon ID.");
		return 1;
	}
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp))
	{
		giveammo = 100000;
	}
	giveammo = strval(tmp);
	if(giveammo < 0 || giveammo > 100000)
	{
		SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid ammo.");
		return 1;
	}
	if(gLogged[playerid] == 1)
	{
		if(PlayerInfo[playerid][pAdmin] >= 3)
		{
			if(IsPlayerConnected(giveplayerid))
			{
				GivePlayerWeapon(giveplayerid, weaponid, giveammo);
				GetPlayerName(playerid, sendername, sizeof(sendername));
				new weaponname[20];
				GetWeaponName(weaponid, weaponname, sizeof(weaponname));
				GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
				format(string,sizeof(string),"AdmCMD: You gave %s \"%s\" with %d ammo",giveplayer, weaponname, giveammo);
				SendClientMessage(playerid, COLOR_CRED, string);
				format(string,sizeof(string),"AdmCMD: Admin %s gave you \"%s\" with %d ammo",sendername, weaponname, giveammo);
				SendClientMessage(giveplayerid, COLOR_CRED, string);
			}
			else
			{
				format(string, sizeof(string), "SERVER: %d isn't a active player ID!", giveplayerid);
				SendClientMessage(playerid, COLOR_GREY, string);
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREY, "SERVER: You don't have permission to use this command.");
		}
	}
	else
	{
		SendClientMessage(playerid, COLOR_GREY, "SERVER: You must be logged in to use this command!");
	}
	return 1;
}

Ik hoop dat iemand me er mee kan helpen

Featured Replies

  • Author

Niet meer nodig!

Het lag een een 2e script die blijkbaar (zonder dat ik het wist) hetzelfde command gebruikte. Gewoon simpel het command van het andere script veranderd, en, VOILA hij doet het :D:D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

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.