14.12.2010, 05:35
the script is real nice .. i'm trying to add score system
what i'm doing wrong ? Oo
score doesn't update and it stays on 0
pawn Код:
new tscore;
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPVarInt(playerid, "training") == 1)
{
if(newkeys & KEY_FIRE && GetPlayerWeapon(playerid) != 0)
{
new Float:x,
Float:y,
Float:z;
GetPosFromView(playerid, 80, x, y, z);
for(new ob,l=MAX_OBJECTS;ob<l;ob++)
{
if(ObjectToPoint(playerid, 1,ob, x, y, z) != 0)
{
tscore++;
DestroyPlayerObject(playerid, ob);
}
}
}
return 1;
}
return 0;
}
pawn Код:
COMMAND:tscore(playerid, params[])
{
new string[128];
format( string, sizeof( string ), "Score = %d", tscore);
SendClientMessage(playerid, FAILURE, string );
return 1;
}
score doesn't update and it stays on 0