SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 30/04/2010, 10:00 PM   #1
master2die
Little Clucker
 
master2die's Avatar
 
Join Date: Apr 2010
Posts: 19
Reputation: 0
Default problem: give player weapons via if()

Hey guys.

Well, i really love coding with pawno and see that everythings running, what i created, but... i have 1 question i cannot answer by myself or any friends. dont laugh, it seems to be easy, but we will see

i want, that you get via if a weapon, which is defined by me.

example:
Code:
 
if(GetPlayerScore(playerid) == '1'){
	GivePlayerWeapon(playerid,WEAPON_M4,500);
	return 0;
	}
I used this on public OnPlayerUpdate(playerid). Now i what to give a player the weapon m4 if a score of a player is = 1. but how?

i would be very thankful for any help you could offer me. of course you can ask, if there would be any questions to me.

greetz
master2die is offline  
Old 30/04/2010, 10:21 PM   #2
Elmin
Little Clucker
 
Elmin's Avatar
 
Join Date: Aug 2009
Location: Bosnia and Herzegovina
Posts: 47
Reputation: 1
Default Re: problem: give player weapons via if()

if(GetPlayerScore(playerid) >1) {
GivePlayerWeapon(playerid, 30, 1000);//u chose what weapons u want to put or use samp king to get id-s for weaps
GivePlayerWeapon(playerid, 16, 1000);
GivePlayerWeapon(playerid, 28, 1000);
GivePlayerWeapon(playerid, 34, 1000);
return 1;
}

Try this if nothing i tryed to help
__________________
Founder and owner of The Matrix Stuntings's Server -TMS 2010-2016
Elmin is offline  
Old 30/04/2010, 10:45 PM   #3
master2die
Little Clucker
 
master2die's Avatar
 
Join Date: Apr 2010
Posts: 19
Reputation: 0
Default Re: problem: give player weapons via if()

well thanks for that, but i want it exactly on stats = 1. i just tried what i did and nothing happns.

greetz
master2die is offline  
Old 30/04/2010, 11:22 PM   #4
Retardedwolf
High-roller
 
Retardedwolf's Avatar
 
Join Date: Jun 2009
Posts: 1,466
Reputation: 60
Default Re: problem: give player weapons via if()

pawn Code:
if(GetPlayerScore(playerid) == 1) {
   GivePlayerWeapon(playerid, weaponid, ammo);
   return 1;
}
Retardedwolf is offline  
Old 30/04/2010, 11:28 PM   #5
iLinx
High-roller
 
Join Date: Jun 2009
Location: Toronto
Posts: 1,498
Reputation: 157
Default Re: problem: give player weapons via if()

Quote:
Originally Posted by www.******.com
pawn Code:
if(GetPlayerScore(playerid) == 1) {
  GivePlayerWeapon(playerid, weaponid, ammo);
  return 1;
}
pawn Code:
if(GetPlayerScore(playerid) == 1)
  return GivePlayerWeapon(playerid, weaponid, ammo);

Simplified, ;P
And you shouldn't be using OnPlayerUpdate for something like that, unless you want the player getting 500 rounds every like, tenth of a second.
__________________
Servers in Arizona, Virginia, Quebec (Canada), United Kingdom, Netherlands. Over 12,000 served. Free cPanel web hosting is included with ALL servers. ********. *******.
iLinx is offline  
Old 01/05/2010, 07:18 AM   #6
master2die
Little Clucker
 
master2die's Avatar
 
Join Date: Apr 2010
Posts: 19
Reputation: 0
Default Re: problem: give player weapons via if()

oh well thank you so much Can you give me another hint?
I want that users on score 5 with the 'killerid' automatically give out a game message with their name and a win message. i tried some things, but i want a gamemode restart after it and my server crashed....

thanks,
m2d
master2die is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
give his gun to a player? Headshot1108 Help Archive 5 02/05/2010 03:23 AM
MOVED: problem: give player weapons via if() dugi Server Support 0 01/05/2010 10:29 AM
How to give a killer his victim's weapons? pmk1 Help Archive 16 20/03/2010 05:37 PM
Give weapons when you tele? Quest123 Help Archive 1 30/10/2009 10:43 AM
Command To Give Weapons Dmac_91 Help Archive 4 27/05/2009 08:19 AM


All times are GMT. The time now is 06:50 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.