Need Help with GivePlayerWeapon -
Tigerbeast11 - 11.10.2009
Код:
public OnPlayerSpawn(playerid)
{
GivePlayerWeapon(playerid, 348, 1500);
GivePlayerWeapon(playerid, 351, 1500);
GivePlayerWeapon(playerid, 353, 1500);
GivePlayerWeapon(playerid, 355, 1500);
GivePlayerWeapon(playerid, 358, 1500);
GivePlayerWeapon(playerid, 331, 1);
printf("Player ID %d has spawned!",playerid);
return 1;
}
When the player spawns, he doesnt get these weapons!! Why?? Its seriously annoying me!
One more thing:
Код:
forward KillingSpree3(playerid);
forward KillingSpree10(playerid);
public KillingSpree3(playerid)
{
if(GetPlayerScore(playerid) >= 3)
{
new PlayerName[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "[Spree] %s is now on a killing spree!", PlayerName);
SendClientMessageToAll(COLOR_GREEN, string);
}
}
public KillingSpree10(playerid)
{
if(GetPlayerScore(playerid) >= 10)
{
new PlayerName[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "[Spree] %s has been awarded a Minigun! Stop him before he damages the whole place!", PlayerName);
SendClientMessageToAll(COLOR_GREEN, string);
GivePlayerWeapon(playerid, 362, 3000);
}
}
All this does is send the player a message saying your on a killing spree for every kill they get! And it only send the message to the player when it should send it to all!!
Plz help me!! The script compiles with no errors, but like i mentioned, it doesnt do what its meant to... Plz tell me if u have a better way to put all this...
Greetz
Re: Need Help with GivePlayerWeapon -
Abernethy - 11.10.2009
You're using the wrong ID's.
http://weedarr.wikidot.com/gunlist
Use the ID's, not the model IDs.
Re: Need Help with GivePlayerWeapon -
boelie - 11.10.2009
Well i know your first problem;
You put to many giveplayerweapons in onplayerspawn. each player has only 3 weaponslots to code.
So delete at least 3 of them and look what happens.
If you realy want the player to have more weapons from start then i suggest you try it with 'pickups' .
Maybe if you put them on the exact spawn location then it might work.
good luck!
EDIT:
Quote:
Use the ID's, not the model IDs.
|
lol ye thats also the problem i didnt even saw that
Re: Need Help with GivePlayerWeapon -
Tigerbeast11 - 11.10.2009
Okay thnx guys, but what about the second thing, it only sends the message to the player, why
![Huh?](images/smilies/confused.gif)
![Huh?](images/smilies/confused.gif)
![Huh?](images/smilies/confused.gif)
?
Re: Need Help with GivePlayerWeapon -
usa.vs.iraq - 11.10.2009
max weapons is 3 per skin or player, if you want more weapons you need to buy them at ammo nation or creating pickups with weapons, is the other guy said, but make shure you have the right weapon's id's
[ID'S]
Re: Need Help with GivePlayerWeapon -
usa.vs.iraq - 11.10.2009
Quote:
Originally Posted by Tigerbeast11
|
if it is SendClientMessageToAll it will send the message to everyplayer, you might have not seen it for other people cause you the only person that is testing the gm
Re: Need Help with GivePlayerWeapon -
Abernethy - 11.10.2009
Uh, GivePlayerWeapon has no limits. AddClassSelection is the function that has a limit to three weapons. I guess that is what you were refering too.
Try this.
pawn Код:
forward KillingSpree3(playerid);
forward KillingSpree10(playerid);
public KillingSpree3(playerid)
{
if(GetPlayerScore(playerid) >= 3)
{
new PlayerName[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "[Spree] %s is now on a killing spree!", PlayerName);
}
SendClientMessageToAll(COLOR_GREEN, string);
}
public KillingSpree10(playerid)
{
if(GetPlayerScore(playerid) >= 10)
{
new PlayerName[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "[Spree] %s has been awarded a Minigun! Stop him before he damages the whole place!", PlayerName);
GivePlayerWeapon(playerid, 362, 3000);
}
SendClientMessageToAll(COLOR_GREEN, string);
}
By the way
Why use this, it is only going to print their ID, no way to tell who that player is in the server logs.
pawn Код:
printf("Player ID %d has spawned!",playerid);
You might want to use this.
pawn Код:
new string[70], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
printf("Player %s [%d] has spawned!", pName, playerid);
Re: Need Help with GivePlayerWeapon -
Tigerbeast11 - 11.10.2009
Can some one help me fix my 2nd error plz!!!
Re: Need Help with GivePlayerWeapon -
Abernethy - 11.10.2009
Quote:
Originally Posted by Tigerbeast11
|
Read my post. -_-
Re: Need Help with GivePlayerWeapon -
Tigerbeast11 - 11.10.2009
Quote:
Originally Posted by Abernethy♥
Quote:
Originally Posted by Tigerbeast11
|
Read my post. -_-
|
Its the same, btw, still not working!