problem: give player weapons via if()
#1

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:
Код:
 
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
Reply
#2

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
Reply
#3

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

greetz
Reply
#4

pawn Код:
if(GetPlayerScore(playerid) == 1) {
   GivePlayerWeapon(playerid, weaponid, ammo);
   return 1;
}
Reply
#5

Quote:
Originally Posted by www.******.com
pawn Код:
if(GetPlayerScore(playerid) == 1) {
  GivePlayerWeapon(playerid, weaponid, ammo);
  return 1;
}
pawn Код:
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.
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)