Jump to content

Custom Weapon Names


Xtrem_Maddox

Recommended Posts

Salut. Ma tot chinui sa caut tutoriale in legatura cu asta, dar nu gasesc, asa ca apelez la voi. Observ pe tot mai multe servere (de Roleplay, bineinteles) ca poti avea aceeasi arma (de exemplu Deagle) si sa se cheme in inventar la tine (ipotetic) de exemplu Glock. Sau poti sa ai tot Deagle, dar in inventar sa se cheme Beretta.

 

Aveti vreo idee cum se face asta?

Link to comment
Share on other sites

Salut @Xtrem_Maddox,

Pai e foarte simplu. Iti las mai jos un exemplu:

function CustomWeapName( weapon_id ) { //weapon_id = id-ul armei, pe care il detectezi cu GetPlayerWeaponID
	new String[ 17 ];
	switch( weapon_id ) {
		case 24: String = "Numele armei" // 24 = idul armei pe samp (adica arma desert eagle / deagle)
		case 31: String = "Numele armei" // 31 = idul armei pe samp (adica arma m4)
		//si tot asa
	}
	return String; }

Asta ar fi cred ca cea mai simpla varianta.

Dupa, detectezi numele armei folosind functia respectiva. (EX: format( String, sizeof String, "Arma ta este: %s", CustomWeapName(GetPlayerWeaponID(playerid)) ); )

Edited by shane
  • Like 1

Daca te-am ajutat =>

spacer.png

Link to comment
Share on other sites

Acum 30 minute, shane a spus:

Salut @Xtrem_Maddox,

Pai e foarte simplu. Iti las mai jos un exemplu:

function CustomWeapName( weapon_id ) { //weapon_id = id-ul armei, pe care il detectezi cu GetPlayerWeaponID
	new String[ 17 ];
	switch( weapon_id ) {
		case 24: String = "Numele armei" // 24 = idul armei pe samp (adica arma desert eagle / deagle)
		case 31: String = "Numele armei" // 31 = idul armei pe samp (adica arma m4)
		//si tot asa
	}
	return String; }

Asta ar fi cred ca cea mai simpla varianta.

Dupa, detectezi numele armei folosind functia respectiva. (EX: format( String, sizeof String, "Arma ta este: %s", CustomWeapName(GetPlayerWeaponID(playerid)) ); )

Iti multumesc foarte mult. M-a ajutat in mare parte. In schimb, ai putea sa-mi spui daca e posibil sa pui 2 nume diferite la aceeasi arma? (de exemplu, la un player care are un Deagle pe el, arma sa se cheme Glock, iar la alt player care are /tot/ Deagle pe el, arma sa se cheme Beretta)?

Link to comment
Share on other sites

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

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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