Need help with command! (zcmd) giving +1 score
#1

Код:
CMD:gresp(playerid, params[])
{
	SendClientMessage(playerid, 0xFFFFFFFF, "You have gain Respect point"); // Send message to player
	SetPlayerScore(playerid,(PlayerInfo[playerid][pRespect] = PlayerInfo[playerid][pRespect]++;); //in this line
	return 1;
}

Error:
error 001: expected token: ")", but found ";"
Thank you for your help
Reply
#2

pawn Код:
CMD:gresp(playerid, params[])
{
    SendClientMessage(playerid, 0xFFFFFFFF, "You have gain Respect point"); // Send message to player
    SetPlayerScore(playerid,(PlayerInfo[playerid][pRespect] = PlayerInfo[playerid][pRespect]++)); //in this line
    return 1;
}
Reply
#3

Ty mate
Reply
#4

No problem!
Reply
#5

Hmm it didnt worked like I wanted. so the prob was I wanted to save it in Y_ini and gived a +1 score but I dont know how to do it Can you help me if you have time.

Thanks again
Reply
#6

pawn Код:
CMD:gresp(playerid, params[])
{
    SendClientMessage(playerid, 0xFFFFFFFF, "You have gain Respect point"); // Send message to player
    SetPlayerScore(playerid, +1);
    PlayerInfo[playerid][pRespect]++;
    return 1;
}
Reply
#7

And it will save in corret player name ? or?

Код:
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line


    SetPlayerScore(playerid, +1); // this line all 4 warnings :D
Reply
#8

pawn Код:
CMD:gresp(playerid)
{
    SendClientMessage(playerid, 0xFFFFFFFF, "You have gained a respect point"); // Send message to player
    new CurrentScore;
    GetPlayerScore(playerid, CurrentScore)
    SetPlayerScore(playerid, CurrentScore +1);
    PlayerInfo[playerid][pRespect]++;
    return 1;
}
Reply
#9

pawn Код:
CMD:gresp(playerid)
{
    SendClientMessage(playerid, 0xFFFFFFFF, "You have gained a respect point"); // Send message to player
    SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
    PlayerInfo[playerid][pRespect]++;
    return 1;
}
@above poster your code would return errors(tag mismatch).
Reply
#10

Quote:

CMD:gresp(playerid)
{
new pID, Message[60],playername[MAX_PLAYER_NAME],targetName[MAX_PLAYER_NAME],string[128],string2[128];
if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xAFAFAFAA, "Invalid Player"); // Checks if the player he attemps to send to is invalid if not it will send and error message
format(string, sizeof(string), "You have get a respect point from %s: %s", playername, Message); // Will format the string the first %s is the name of the guy who sent pm second %s in the Message
format(string2, sizeof(string2), "Gived to %s: %s", targetName, Message); // The same as above but this time it shows the name off the player you sent it to
GetPlayerName(pID, targetName, sizeof(targetName)); // Gets the Name of The Target 1st param and stores it in targetName
GetPlayerName(playerid, playername, sizeof(playername));
new CurrentScore;
GetPlayerScore(playerid, CurrentScore);
SetPlayerScore(playerid, CurrentScore +1);
PlayerInfo[playerid][pRespect]++;
return 1;
}

I need to not alow your self to give you a respect point only another player and by player name or id. PLS help me out. I'm learning... PLS Some one help me with it.. I will give +resp..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)