What is wrong with this script => (problems with Attach3DTextLabelToPlayer)?
#1

Hi!

I want to make a script that it will put the 3D text above npc. This text should be showing a npcs name:

heres a script:
pawn Код:
#include <a_samp>

new NPC_YUGO;

public OnFilterScriptInit()
{
ConnectNPC("YUGO","yugodriver");
NPC_YUGO = AddStaticVehicle(565, 0.0, 0.0, 5.0, 0.0, 1, 1);
   
ConnectNPC("Clovek","ljudje");
ConnectNPC("Clovek1","ljudje1");
   
SetTimer("Text",10,1);
return 1;
}

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "YUGO", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, NPC_YUGO, 0); //Putting the NPC into the vehicle we created for it.
SetSpawnInfo( playerid, 0, 33, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );//use when you want to select skin for NPCs
}
   
else if(!strcmp(npcname, "Clovek", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, NPC_YUGO, 0); //Putting the NPC into the vehicle we created for it.
SetSpawnInfo( playerid, 0, 33, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );//use when you want to select skin for NPCs
}
   
else if(!strcmp(npcname, "Clovek1", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, NPC_YUGO, 0); //Putting the NPC into the vehicle we created for it.
SetSpawnInfo( playerid, 0, 33, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );//use when you want to select skin for NPCs
}
return 1;
}
return 1;
}



forward Text(playerid);
public Text(playerid)
{
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "YUGO", true))
{

     
new text;
text = Create3DTextLabel("Jaz sem YUGO",GetPlayerColor(npcname),30.0,40.0,50.0,40.0,0); //line 59
new Float:x, Float:y, Float:z, string[256];
GetPlayerPos(npcname, x, y, z); //line 61
format(string, sizeof(string), "%s,%s,%s",x,y,z);
     

Attach3DTextLabelToPlayer(text, npcname, string); //line 65
}
}
}

And it says these errors
Код:
C:\Documents and Settings\Anћe Miklavčič\Desktop\sa mp server\filterscripts\NPC.pwn(59) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Anћe Miklavčič\Desktop\sa mp server\filterscripts\NPC.pwn(59) : warning 213: tag mismatch
C:\Documents and Settings\Anћe Miklavčič\Desktop\sa mp server\filterscripts\NPC.pwn(61) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Anћe Miklavčič\Desktop\sa mp server\filterscripts\NPC.pwn(65) : warning 213: tag mismatch
C:\Documents and Settings\Anћe Miklavčič\Desktop\sa mp server\filterscripts\NPC.pwn(65) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Thank you for help
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)