SA-MP Forums Archive
A Little Help with my scripting :P - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A Little Help with my scripting :P (/showthread.php?tid=271724)



A Little Help with my scripting :P - fie - 25.07.2011

There seems to be a problem :/

I have this code
Quote:

public OnPlayerSpawn(playerid)
{
if(IsPlayerVipMember(playerid))
{
if(IsPlayerConnected(playerid))
{

new sendername[MAX_PLAYER_NAME];
new string[128];
format(string, sizeof(string), "VIP Member %s (Id:%d) has just joined the server", sendername);
SendClientMessageToAll(0xFFFF00AA, string);

}

}
return 1;
}
[/QUOTE]

It compiles fine but when the VIP Joins it just says "VIP Member Id:[Randomnumber thats not true] has joined the server"





Second problem :P

Code:
Quote:

public OnPlayerSpawn(playerid)
{
if(IsPlayerVipMember(playerid))
{
if(IsPlayerConnected(playerid))
{

new PlayerText3D:PlayerVIPText;
new Float:X, Float:Y, Float:Z;
GetPlayerPos( playerid, X, Y, Z );
PlayerVIPText = CreatePlayer3DTextLabel(playerid,"VIP Player",0x008080FF,X,Y,Z,40.0);

}
}
return 1;
}

Compiles with a few errors

Quote:

C:\Users\Joe\Desktop\New Folder\filterscripts\vip.pwn(47) : warning 213: tag mismatch
C:\Users\Joe\Desktop\New Folder\filterscripts\vip.pwn(5 : warning 217: loose indentation
C:\Users\Joe\Desktop\New Folder\filterscripts\vip.pwn(61) : warning 219: local variable "PlayerVIPText" shadows a variable at a preceding level
C:\Users\Joe\Desktop\New Folder\filterscripts\vip.pwn(64) : warning 204: symbol is assigned a value that is never used: "PlayerVIPText"
C:\Users\Joe\Desktop\New Folder\filterscripts\vip.pwn(64 -- 6 : warning 217: loose indentation

And when the VIP connects there is no 3d tag :/



I would appritiate it alot if anyone could help


Re: A Little Help with my scripting :P - Shockey HD - 25.07.2011

Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerVipMember(playerid))
{
if(IsPlayerConnected(playerid))
{

new sendername[MAX_PLAYER_NAME];
new string[128];
format(string, sizeof(string), "VIP Member %s (Id:%d) has just joined the server", sendername);
SendClientMessageToAll(0xFFFF00AA, string);
That code is not fully finished, theres more to getting the IP than what you have supplied


Re: A Little Help with my scripting :P - Libra_PL - 25.07.2011

About the first problem, you forgot to get player's name. Add this before the message:

Код:
GetPlayerName(playerid, sendername, sizeof(sendername));
And the second, should be (I'm not sure)

Код:
new Text3D:PlayerVIPText;
new Float:X, Float:Y, Float:Z;
GetPlayerPos( playerid, X, Y, Z );
PlayerVIPText = CreatePlayer3DTextLabel(playerid,"VIP Player",0x008080FF,X,Y,Z,40.0);



Re: A Little Help with my scripting :P - PrawkC - 25.07.2011

For the second problem, have a look at https://sampwiki.blast.hk/wiki/Attach3DTextLabelToPlayer