27.08.2010, 08:06
So, I got this:
The problem is, that if I use stuntid, that nothing happens, but if I use i, it happens on all the checkpoints, and I always get all the score and money that are defined.. So I only want that the checkpoint I entered goes away for only myself, and that I get the score and money that I defined.
Example:
So, how to do that I only get the money and score for the checkpoint im standing in, and that the checkpoint disappears after that?
pawn Код:
forward StuntCompleted(playerid);
public StuntCompleted(playerid)
{
new stuntid = GetStuntID(playerid);
for(new i=0; i<MAX_STUNTS; i++)
{
GivePlayerMoney(playerid, StuntMoney[i]);
new str2[128];
format(str2, sizeof(str2), "You have received %d dollars and %d score", StuntMoney[stuntid], StuntScore[stuntid]);
SendClientMessage(playerid, c_y, str2);
SetPlayerScore(playerid, (GetPlayerScore(playerid))+ StuntScore[stuntid]);
TogglePlayerDynamicCP(playerid, StuntCheckpoint[stuntid], 0);
}
return 1;
}
Example:
pawn Код:
AddStunt(stuntid, Float:iconX, Float:iconY, Float:iconZ, Moneya, Scorea)
AddStunt(0, 1303.040405,1291.831787,68.269271, 110,1); //stunt1