Help on player spawn -
MyBozz - 07.08.2011
Hello, I need some help on my
Zombie Script.
On player spawn I made this code here:
Quote:
if(Equipo[playerid] == E_Zombie)
{
new rand = random(sizeof(ZombieSpawn));
SetPlayerPos(playerid, ZombieSpawn[rand][0], ZombieSpawn[rand][1]);
SetPlayerColor(playerid, Rojo);
GivePlayerWeapon(playerid, 335, 1);
GivePlayerWeapon(playerid, 365, 99999);
GameTextForPlayer(playerid,"~r~Zombie",4000,1);
label[playerid] = Create3DTextLabel("Zombie",Rojo,30.0,40.0,50.0,40. 0,0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
}
if(Equipo[playerid] == E_Human)
{
new rand = random(sizeof(HumanSpawn));
SetPlayerPos(playerid, HumanSpawn[rand][0], HumanSpawn[rand][1]);
SetPlayerColor(playerid, Blanco);
GivePlayerWeapon(playerid, 349, 500);
GivePlayerWeapon(playerid, 368, 1);
GivePlayerWeapon(playerid, 341, 1);
GivePlayerWeapon(playerid, 342, 5);
GameTextForPlayer(playerid,"~w~Human",4000,1);
label[playerid] = Create3DTextLabel("Human",Blanco,30.0,40.0,50.0,40 .0,0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
}
|
I made it to give each team its own weapons and Labels and player colors on each team.
But the weapons dont work. It dosent give the players its weapons.
and on the Labels some times it gets scrude up exampel:
Player ID: 1 Joind my server as human team then his label says Human. then he desconnectes.
Then another player Joins my server as ID: 1 as zombie team. Hes Label says Human Zombie! Both! and its soposed to be zombie! Help! i dont know what to do!
Also i wish if some one to give me a little script to eject the zombie team out of the vehicles. Please i hope u understand.
Re: Help on player spawn -
Backwardsman97 - 07.08.2011
Try using an else statement there and make sure you are setting their teams correctly. As for the label thing, make sure you're deleting the labels when the players leave and resetting the variable to store the id's.
Re: Help on player spawn -
[MG]Dimi - 07.08.2011
GivePlayerWeapon(playerid, 335, 1);
GivePlayerWeapon(playerid, 365, 99999);
wut is that? These are maybe weapons objects models IDs.
Here you can get
weapons IDs
Use number on left (ID), not model ID
-
MyBozz - 07.08.2011
Thanks but can u give me the thing to delet labels i dont know how to make it xD.
i only gave the weapons as an example i know the weapons id's but thanks anyway. Those weapons id are death mesage ids.
Re: Help on player spawn -
[MG]Dimi - 07.08.2011
Create3DTextLabel(text[], color, Float:X, Float:Y, Float:Z, FloatrawDistance, virtualworld, testLOS)
Create3DTextLabel("Human",Blanco,30.0,40.0,50.0,40 .0,0,//you are missing testLOS);
use this one:
label[playerid] = Create3DTextLabel("Human",Blanco,30.0,40.0,50.0,40 .0,0,1);
EDIT: Complete code:
PHP код:
if(Equipo[playerid] == E_Zombie)
{
new rand = random(sizeof(ZombieSpawn));
SetPlayerPos(playerid, ZombieSpawn[rand][0], ZombieSpawn[rand][1]);
SetPlayerColor(playerid, Rojo);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 41, 99999);
GameTextForPlayer(playerid,"~r~Zombie",4000,1);
label[playerid] = Create3DTextLabel("Zombie",Rojo,30.0,40.0,50.0,40.0,0,0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
}
if(Equipo[playerid] == E_Human)
{
new rand = random(sizeof(HumanSpawn));
SetPlayerPos(playerid, HumanSpawn[rand][0], HumanSpawn[rand][1]);
SetPlayerColor(playerid, Blanco);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 44, 1);// DOnt use Nightvision, will effect on whole server!
GivePlayerWeapon(playerid, 9, 1);
GivePlayerWeapon(playerid, 16, 5);
GameTextForPlayer(playerid,"~w~Human",4000,1);
label[playerid] = Create3DTextLabel("Human",Blanco,30.0,40.0,50.0,40.0,0,0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
}
Re: Help on player spawn -
MyBozz - 07.08.2011
Thanks! But what about when a player leaves the server how to delet text label??
Re: Help on player spawn -
[MG]Dimi - 07.08.2011
Delete3DTextLabel(label[playerid]);
Re: Help on player spawn -
MyBozz - 07.08.2011
Thanks!