presentation system
#1

Hello

How can I resolve to see the other player's name forever, and she is mine,If we introduce each other with the help of command? Example: A player /hello, the other player /helloaccept. and if we step out or we enter we would see each other's name likewise.

help please!

role play should this script..
Reply
#2

Sorry it was my mistake check the post down there
Reply
#3

To the above post: not really..

You have to use these functions:

https://sampwiki.blast.hk/wiki/ShowPlayerNameTagForPlayer
https://sampwiki.blast.hk/wiki/OnPlayerStreamIn

If you want for such variables to save, then SQL would be the best way to store player relationships.
(relationships table: one column AND one row per every player)

Layout:

pawn Код:
player  BOB     CHRIS   JOE

BOB     null    1       0
CHRIS   1       null    1
JOE     0       1       null


Bob knows Chris, and doesn't know joe
Chris knows both bob and joe
Joe doesn'
t know bob but knows chris
Example

SELECT * FROM `relationships` WHERE `player` = 'BOB' AND `CHRIS` = 1

If there's any result then bob is a friend of chris, else, they are not friends.
Reply
#4

I went so far. How can you save? Would you describe it to me?

#include <a_samp>
#include <sscanf2>
#include <zcmd>
#include <dini>
#define COLOR_WHITE 0xFFFFFFAA
//
new Names[MAX_PLAYERS][3];
//
public OnFilterScriptInit()
{
ShowNameTags ( 0 ) ;
return 1;
}

CMD:bemutatkoz(playerid, params[])
{
new ID;
#pragma tabsize 0
new string[200], item[32];
new mName[MAX_PLAYER_NAME];
new pName[MAX_PLAYER_NAME];
new Float:X, Float: Y, Float:Z;
if(sscanf(params, "u",item, ID)) return SendClientMessage(playerid, -1, "Hasznбlat: /bemutatkozas neki ID/Nйv");
GetPlayerPos(playerid, X, Y, Z);
if(!IsPlayerInRangeOfPoint(ID, 5.0, X, Y, Z)) return SendClientMessage(playerid, -1, "Nincs a megadott jбtйkos a kцzeledben!");
if(strcmp(item,"neki",true) == 0) {
if (sscanf(params, "s[32]u",item, ID)) return SendClientMessage(playerid, -1, "Hasznбlat: /bemutatkozбs neki [ID/Nйv]");
GetPlayerName(playerid, mName, sizeof(mName));
GetPlayerName(ID, pName, sizeof(pName));
format(string, sizeof(string), "(( %s szeretne az ismerősцd lenni. ))", mName);
SendClientMessage(ID, COLOR_WHITE, string);
SendClientMessage(ID, COLOR_WHITE, "(( Bemutatkozбshoz: /bemutatkozas");
format(string, sizeof(string), "(( Felajбnlottad hogy szeretnйl bemutatkozni %s-nak", pName);
SendClientMessage(playerid, COLOR_WHITE, string);
Names[ID][0] = 1;
}
return 1;
}

CMD:bemutatkozas(playerid, params[])
{
new ID;
#pragma tabsize 0
new string[200];
new mName[MAX_PLAYER_NAME];
new pName[MAX_PLAYER_NAME];
// new Float: X, Float: Y, Float: Z;
if(Names[playerid][0] == 1)
{
SendClientMessage(playerid, -1, "(( Bemutatkoztбl valakinek! ))");
GetPlayerName(playerid, mName, 24);
GetPlayerName(ID, pName, 24);
format( string, sizeof ( string ), "(( %s bemutatkozott neked. ))", mName);
SendClientMessage( ID, -1, string );
ShowPlayerNameTagForPlayer(playerid, ID, true);
ShowPlayerNameTagForPlayer(ID, playerid, true);
}
Reply
#5

Quote:
Originally Posted by CuervO
Посмотреть сообщение
If you want for such variables to save, then SQL would be the best way to store player relationships.
(relationships table: one column AND one row per every player)

Layout:

pawn Код:
player  BOB     CHRIS   JOE

BOB     null    1       0
CHRIS   1       null    1
JOE     0       1       null


Bob knows Chris, and doesn't know joe
Chris knows both bob and joe
Joe doesn'
t know bob but knows chris
Example

SELECT * FROM `relationships` WHERE `player` = 'BOB' AND `CHRIS` = 1

If there's any result then bob is a friend of chris, else, they are not friends.
You're doing SQL wrong! Your table should only need 2 columns, not as many columns as you have players - that's not what SQL is designed for!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)