Рекомендованные сообщения



Не найдено.

2 posts in this topic

Спойлер

public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid, player_info[playerid][NAME], MAX_PLAYER_NAME);
    static const fmt_query[] = "SELECT 'id' FROM 'users' WHERE 'name' = '$s'";
    new query[sizeof(fmt_query)+(-2+MAX_PLAYER_NAME)];
    format(query, sizeof(query), fmt_query, player_info[playerid][NAME]);
    mysql_tquery(dbHandle, query, "CheckRegistration", "1", playerid);
    return 1;
}

forward CheckRegistration(playerid);
public CheckRegistration(playerid)
{
    new rows;
    cache_get_row_count(rows);
    if(rows) ShowLogin(playerid);
    else ShowRegistration(playerid);
}

stock ShowLogin(playerid)
{
    SendClientMessage(playerid, COLOR_LIME, "игрок зарегестривован");
}

stock ShowRegistration(playerid)
{
    SendClientMessage(playerid, COLOR_RED, "игрок не зарегестрирован");
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

 

вот скрипн он не работает

Share this post


Link to post
Share on other sites

@Кирилл2509, попробуйте заменить следующим:

Спойлер

public OnPlayerConnect(playerid)
{
	GetPlayerName(playerid, player_info[playerid][NAME], MAX_PLAYER_NAME);
	static const fmt_query[] = "SELECT 'id' FROM 'users' WHERE 'name' = '$s'";
	new query[sizeof(fmt_query)+(-2+MAX_PLAYER_NAME)];
	format(query, sizeof(query), fmt_query, player_info[playerid][NAME]);
	mysql_tquery(dbHandle, query, "CheckRegistration", "i", playerid);
	return 1;
}

forward CheckRegistration(playerid);
public CheckRegistration(playerid)
{
	new rows;
	cache_get_row_count(rows);
	if(rows) ShowLogin(playerid);
	else ShowRegistration(playerid);
	
	return 1;
}

stock ShowLogin(playerid)
{
	SendClientMessage(playerid, COLOR_LIME, "игрок зарегестривован");
}

stock ShowRegistration(playerid)
{
	SendClientMessage(playerid, COLOR_RED, "игрок не зарегестрирован");
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

 

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Roman_Zimin
      By Roman_Zimin
      Здравствуйте, подскажите или направьте на тему, мне нужна такая функция чтобы при нажатии на тексдрав вызывалась нажатие кнопки например Q. Можно ли как то реализовать?