Score Problem.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Score Problem.. (
/showthread.php?tid=290008)
Score Problem.. -
Azzeto - 13.10.2011
Hey, I'm having an issue with my score, I made it so when a player dies there score gets added +1, but it doesnt show under TAB. but it saves to the player file, any help? OnPlayerDeath
PHP код:
SendClientMessage(playerid,COLOR_RED,"You've been killed and lost 500$.");
GivePlayerMoney(playerid,-500);
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
PlayerInfo[killerid][pKillPoints]++;
PlayerInfo[playerid][pKillPoints]--;
PlayerInfo[killerid][pScore]++;
PlayerInfo[playerid][pScore]--;
if(killerid != INVALID_PLAYER_ID)
GivePlayerMoney(killerid, 500);
SendClientMessage(killerid,COLOR_GREEN,"You've killed an enemy and earned 500$.");
SendDeathMessage(killerid, playerid, reason);
if(gTeam[killerid] == gTeam[playerid]) {
new string[128];
format(string,sizeof(string),"%s has just killed their teammate, Please warn/kick them.");
}
Re: Score Problem.. -
Stigg - 13.10.2011
https://sampwiki.blast.hk/wiki/SetPlayerScore
https://sampwiki.blast.hk/wiki/GetPlayerScore
Re: Score Problem.. -
Azzeto - 13.10.2011
Alright thanks, I need help with one more thing, my VIP chat command, it works almsot perfect except The first letter doesnt show..
PHP код:
CMD:v(playerid,params[]){
new string[128],message;
if(PlayerInfo[playerid][pVIP] < 1) return SendClientMessage(playerid,COLOR_GRAY,"You're not authorized to use this command!");
if(sscanf(params,"s",message)) return SendClientMessage(playerid,COLOR_GRAY,"Syntax: /v [message]");
else
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pVIP] < 1) return 0;
format(string,sizeof(string),"[VIP]%s: %s",GetName(playerid),string);
SendClientMessage(i,COLOR_GOLD,string);
}
return 1;
}
Re: Score Problem.. -
Wesley221 - 13.10.2011
pawn Код:
format(string,sizeof(string),"[VIP]%s: %s",GetName(playerid),string);
Youre trying to format 'string', in the string 'string'. The last string should be 'message'
pawn Код:
format(string,sizeof(string),"[VIP]%s: %s",GetName(playerid),message);
Re: Score Problem.. -
Azzeto - 13.10.2011
Oh wow fail.. IDK why I put string there, thought I did put message
Repped you both