05.02.2015, 20:05
I created for the /spectate some textdraw thats showing some information but its showing my information instand of the other players information and i dont know the problem.
pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
new userid;
new string[128],string1[128],string2[128],string3[128],string4[128],string5[128],string6[128],string7[128],string8[128],string9[128];
if(userid != INVALID_PLAYER_ID)
{
new ip[16], Float:H, Float:A;
GetPlayerIp(userid, ip, sizeof(ip));
GetPlayerHealth(userid, H); GetPlayerArmour(userid, A);
format(string, sizeof(string), "Health: %0.1f", H);
PlayerTextDrawSetString(playerid,Health1, string);
format(string1, sizeof(string1), "Armour: %0.1f", A);
PlayerTextDrawSetString(playerid, Armour1, string1);
format(string2, sizeof(string2), "Money: %d", GetPlayerMoney(userid));
PlayerTextDrawSetString(playerid, Money, string2);
format(string3, sizeof(string3), "Name: %s", ReturnName(userid, 0));
PlayerTextDrawSetString(playerid, Name, string3);
format(string4, sizeof(string4), "IP: %s", ip);
PlayerTextDrawSetString(playerid, IP1, string4);
format(string5, sizeof(string5), "%s", PlayerData[userid][CMD1]);
PlayerTextDrawSetString(playerid, sCMD0,string5);
format(string6, sizeof(string6), "%s", PlayerData[userid][CMD2]);
PlayerTextDrawSetString(playerid, sCMD1,string6);
format(string7, sizeof(string7), "%s", PlayerData[userid][CMD3]);
PlayerTextDrawSetString(playerid, sCMD2,string7);
format(string8, sizeof(string8), "%s", PlayerData[userid][CMD4]);
PlayerTextDrawSetString(playerid, sCMD3,string8);
format(string9, sizeof(string9), "%s", PlayerData[userid][CMD5]);
PlayerTextDrawSetString(playerid, sCMD4,string9);
}
}