07.08.2010, 09:18
okay, so my script basically.When player kills other player the killers clan/team gets +1 point, how do i do that with variables and how do i save the clanpoints?
come again?
public OnPlayerDeath(playerid, killerid, reason);
{
if(GetPlayerTeam(playerid) != GetPlayerTeam(killerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerTeam(i) == GetPlayerTeam(killerid)
{
SetPlayerScore(i, GetPlayerScore(i)+1);
return 1;
}
}
}
}
#include <dini>
public OnPlayerDisconnect(playerid)
{
dini_IntSet(playerid, "Score", GetPlayerScore(playerid);
return 1;
}
public OnPlayerConnect(playerid);
{
SetPlayerScore(playerid, dini_Int(playerid, "Score");
return 1;
}
|
You have to use GetPlayerTeam and SetPlayerTeam, together your save score thing would be like:
pawn Код:
pawn Код:
pawn Код:
|
|
1) does this save the CLANS SCORE, it looks like it just saves the players score :/
2) if it does save the CLANS SCORE, then can you explain what it does and how? |
)public OnPlayerDisconnect(playerid)
{
SetPVarInt(playerid, "Score", GetPlayerScore(playerid));
return 1;
}
public OnPlayerConnect(playerid)
{
SetPlayerScore(playerid, GetPVarInt(playerid, "Score"));
return 1;
}
|
You have to use GetPlayerTeam and SetPlayerTeam, together your save score thing would be like:
pawn Код:
pawn Код:
pawn Код:
|