Need help with the score & money award in my TDM. - 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 the score & money award in my TDM. (
/showthread.php?tid=388905)
Need help with the score & money award in my TDM. -
dynetictrinity - 30.10.2012
Fixed!
Re: Need help with the score & money award in my TDM. -
CoaPsyFactor - 30.10.2012
can you show us code where you boy house ?
Re: Need help with the score & money award in my TDM. -
dynetictrinity - 30.10.2012
I'm using the filterscript ( DynamicApartmentSystem ) For houses.
But this is probably it :
PHP код:
CMD:buyapartment(playerid, params[]) // cmd to buy apartment
{
for(new i = 0; i < sizeof(ApartmentInfo); i++)
{
GetPlayerName(playerid, plname, sizeof(plname));
if(strcmp(ApartmentInfo[i][sOwner], plname, false ) == 0)
{
SendClientMessage(playerid, WHITE, "You alerdy have apartment!");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 3,ApartmentInfo[i][sEnterx], ApartmentInfo[i][sEntery], ApartmentInfo[i][sEnterz]) && ApartmentInfo[i][sOwned] == 0)
{
if(GetPlayerMoney(playerid) > ApartmentInfo[i][sPrice])
{
if(GetPlayerScore(playerid) >= ApartmentInfo[i][sLevel])
{
strmid(ApartmentInfo[i][sOwner], plname, 0, strlen(plname), 255);
ApartmentInfo[i][sOwned] = 1;
GivePlayerMoney(playerid,-ApartmentInfo[i][sPrice]);
SendClientMessage(playerid, WHITE, "Congratz on new apartment, type /aphelp to see all commands!");
strmid(ApartmentInfo[i][sOwner], plname, 0, strlen(plname), 255);
LabelIPickup(i);
SaveApartment(i);
return 1;
}
else { SendClientMessage(playerid, GREY, "Your level is too low!"); return 1; }
}
else { SendClientMessage(playerid, GREY, "You don't have enough't money!"); return 1; }
}
}
return 1;
}
Re: Need help with the score & money award in my TDM. -
XtremeR - 31.10.2012
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid,playerid,reason);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
GivePlayerMoney(killerid, 2500);
//playercash = GetPlayerMoney(playerid);
//if (playercash > 0) {
//GivePlayerMoney(killerid, playercash);
//ResetPlayerMoney(playerid);
return 1;
}
this one will work, tried it!
Re: Need help with the score & money award in my TDM. -
dynetictrinity - 31.10.2012
Still get 2500 score
Maybe its something in the old GM cause i use the LVDM from the default gm's of samp.
Re: Need help with the score & money award in my TDM. -
dynetictrinity - 31.10.2012
Okej it works This was the problem :
PHP код:
//public MoneyGrubScoreUpdate()
//{
//new CashScore;
//new name[MAX_PLAYER_NAME];
//new string[256];
//for(new i=0; i<MAX_PLAYERS; i++)
//{
//if (IsPlayerConnected(i))
//{
//GetPlayerName(i, name, sizeof(name));
//CashScore = GetPlayerMoney(i);
//SetPlayerScore(i, CashScore);
//if (CashScore > CashScoreOld)
//{
//CashScoreOld = CashScore;
//format(string, sizeof(string), "$$$ %s is now in the lead $$$", name);
//SendClientMessageToAll(COLOR_YELLOW, string);
//}
//}
//}
//}