Raised This Month: $ Target: $400
 0% 

[SM] Native "GetClientTeam" reported: Client index 0 is invalid


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Razvann.
Senior Member
Join Date: Jul 2012
Old 03-28-2015 , 12:20   [SM] Native "GetClientTeam" reported: Client index 0 is invalid
Reply With Quote #1

Line 222 is the problem
Line 222, vip.sp::OnRoundStart()


This is the 222 line:

if(GetClientTeam(client) > 1)


And this is the all area of code:

Quote:
}

public OnClientSettingsChanged(client)
{
change_tag(client);
change_name(client);
}

public Action:OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
change_tag(GetClientOfUserId(GetEventInt(even t, "userid")));
IsValideRegen[client] = false;

if (GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
{
SetEntityGravity(client, 1.0);
SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, 255, 255, 255, 255);
}

PlayerRespawn[client] = 0;

return Plugin_Handled;
}

public change_tag(client)
{
if (IsClientInGame(client) && Clan_Tag == 1)
{
if (GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
{
CS_SetClientClanTag(client, g_sVip);
}
else
{
CS_SetClientClanTag(client, "");
}
}
}

public OnClientPutInServer(client)
{
change_name(GetClientOfUserId(client));
}

public change_name(client)
{
decl String:name[32];
GetClientName(client, name, sizeof(name));
if (GetUserFlagBits(client) & ADMFLAG_CUSTOM1 && Vip_Name == 1 && StrContains(name, "[VIP]") == -1)
{
new String:new_name[64];
Format(new_name, 64 ,"[VIP] %s", name);
CS_SetClientName(client, new_name,true);
}
}

public Action:OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
for(new i = 1; i <= MaxClients; i++)
{
HasMenu[i] = false;
HasUseMenu[i] = false;
menu_times[i] = 0;
}
if(GetClientTeam(client) > 1)
{
CPrintToChatAll("\x04 Scrie {%s} !vipmenu pentru a deschide meniul VIP", TagTeam);
}
}
When plugin try to change name of the player with VIP doesn't work, instead [VIP] Razvan the plugin change to: name

And also this error appear in Logs:

[SM] Native "GetClientTeam" reported: Client index 0 is invalid

Please help me!

Last edited by Razvann.; 03-28-2015 at 12:25.
Razvann. is offline
Send a message via Yahoo to Razvann.
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode