Score Problem..
#1

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(killerid500);
    
SendClientMessage(killerid,COLOR_GREEN,"You've killed an enemy and earned 500$.");
    
SendDeathMessage(killeridplayeridreason);
    if(
gTeam[killerid] == gTeam[playerid]) {
    new 
string[128];
    
format(string,sizeof(string),"%s has just killed their teammate, Please warn/kick them.");
    } 
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerScore
https://sampwiki.blast.hk/wiki/GetPlayerScore
Reply
#3

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 
0MAX_PLAYERSi++)
    {
        if(
PlayerInfo[i][pVIP] < 1) return 0;
        
format(string,sizeof(string),"[VIP]%s: %s",GetName(playerid),string);
        
SendClientMessage(i,COLOR_GOLD,string);
    }
    return 
1;

Reply
#4

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);
Reply
#5

Oh wow fail.. IDK why I put string there, thought I did put message

Repped you both
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)