Help on player spawn
#1

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.
Reply
#2

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

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

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.
Reply
#5

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(playeridZombieSpawn[rand][0], ZombieSpawn[rand][1]);
SetPlayerColor(playeridRojo);
GivePlayerWeapon(playerid41);
GivePlayerWeapon(playerid4199999);
GameTextForPlayer(playerid,"~r~Zombie",4000,1);
label[playerid] = Create3DTextLabel("Zombie",Rojo,30.0,40.0,50.0,40.0,0,0);
Attach3DTextLabelToPlayer(label[playerid], playerid0.00.00.7);
}
if(
Equipo[playerid] == E_Human)
{
new 
rand random(sizeof(HumanSpawn));
SetPlayerPos(playeridHumanSpawn[rand][0], HumanSpawn[rand][1]);
SetPlayerColor(playeridBlanco);
GivePlayerWeapon(playerid25500);
GivePlayerWeapon(playerid441);// DOnt use Nightvision, will effect on whole server!
GivePlayerWeapon(playerid91);
GivePlayerWeapon(playerid165);
GameTextForPlayer(playerid,"~w~Human",4000,1);
label[playerid] = Create3DTextLabel("Human",Blanco,30.0,40.0,50.0,40.0,0,0);
Attach3DTextLabelToPlayer(label[playerid], playerid0.00.00.7);

Reply
#6

Thanks! But what about when a player leaves the server how to delet text label??
Reply
#7

Delete3DTextLabel(label[playerid]);
Reply
#8

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)