SA-MP Forums Archive
Need help with command! (zcmd) giving +1 score - 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: Need help with command! (zcmd) giving +1 score (/showthread.php?tid=305043)



Need help with command! (zcmd) giving +1 score - Request - 21.12.2011

Код:
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


Re: Need help with command! (zcmd) giving +1 score - -Rebel Son- - 21.12.2011

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;
}



Re: Need help with command! (zcmd) giving +1 score - Request - 21.12.2011

Ty mate


Re: Need help with command! (zcmd) giving +1 score - -Rebel Son- - 21.12.2011

No problem!


Re: Need help with command! (zcmd) giving +1 score - Request - 21.12.2011

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


Re: Need help with command! (zcmd) giving +1 score - -Rebel Son- - 21.12.2011

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;
}



Re: Need help with command! (zcmd) giving +1 score - Request - 21.12.2011

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



Re: Need help with command! (zcmd) giving +1 score - Rob_Maate - 21.12.2011

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;
}



Re: Need help with command! (zcmd) giving +1 score - XFlawless - 21.12.2011

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).


Re: Need help with command! (zcmd) giving +1 score - Request - 21.12.2011

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..