Quote:
Originally Posted by Sew_Sumi
PHP код:
public damagedone(playerid, &Float:amount)
{
new stringg[128];
new Damage[playerid] = amount; // You need to NOT define it here, as it's a global var, not a local variable.
//
//What happens with this, is that you create it in here, and it will only be visible in here, yet it needs tracking for more than just the one instance which is here.
//You have this defined in the main gamemode, and redefining it here is causing the error. Remove this, and you should have more progress.
format(stringg, sizeof(stringg), "You did: %.0f damage in 30 minutes.", Damage[playerid]);
SendClientMessage(playerid, -1, stringg);
Damage[playerid] = 0; // setting it to 0 so on next 30 minutes it wont simply add the current amount on the existing one
return 1;
}
That's not an enum in there, that's an array. You also need to remove it as it's conflicting with the Damage variable that you made prior. Along with it not being a global variable anyway, which it actually needs to be Global.
|
So after all that, where do i make it? you telling me "not, not, not" but no facts on where , for example where do i define this part?
PHP код:
new Damage[playerid] = amount; // You need to NOT define it here, as it's a global var, not a local variable.
//
Top gamemode?
So basically i just need to delete the timer, and make it on the callback where damage is called, if i make it separately like i did there it will have trouble on showing it? But doing that the timer is not there, and therefore it will not be shown again in some amount of time. Which i actually want it to happen.
But the last thing that i wanted to tell you
PHP код:
//You have this defined in the main gamemode, and redefining it here is causing the error. Remove this, and you should have more progress.
format(stringg, sizeof(stringg), "You did: %.0f damage in 30 minutes.", Damage[playerid]);
Why should i delete the format ? lol